idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
900
protected void registerDraggableAttributes ( ) { addAttributeProcessor ( new BlockInputLmlAttribute ( ) , "blockInput" ) ; addAttributeProcessor ( new DeadzoneRadiusLmlAttribute ( ) , "deadzone" , "deadzoneRadius" ) ; addAttributeProcessor ( new DraggedAlphaLmlAttribute ( ) , "alpha" ) ; addAttributeProcessor ( new DraggedFadingInterpolationLmlAttribute ( ) , "fadingInterpolation" ) ; addAttributeProcessor ( new DraggedFadingTimeLmlAttribute ( ) , "fadingTime" ) ; addAttributeProcessor ( new DraggedMovingInterpolationLmlAttribute ( ) , "movingInterpolation" ) ; addAttributeProcessor ( new DraggedMovingTimeLmlAttribute ( ) , "movingTime" ) ; addAttributeProcessor ( new DragListenerLmlAttribute ( ) , "listener" ) ; addAttributeProcessor ( new InvisibleWhenDraggedLmlAttribute ( ) , "invisible" , "invisibleWhenDragged" ) ; addAttributeProcessor ( new KeepDraggedWithinParentLmlAttribute ( ) , "keepWithinParent" ) ; }
Draggable listener attributes .
901
protected void registerGridGroupAttributes ( ) { addAttributeProcessor ( new GridSpacingLmlAttribute ( ) , "spacing" ) ; addAttributeProcessor ( new ItemHeightLmlAttribute ( ) , "itemHeight" ) ; addAttributeProcessor ( new ItemSizeLmlAttribute ( ) , "itemSize" ) ; addAttributeProcessor ( new ItemWidthLmlAttribute ( ) , "itemWidth" ) ; addAttributeProcessor ( new BlockIndexesLmlAttribute ( ) , "blockIndexes" ) ; addAttributeProcessor ( new ItemsAmountLmlAttribute ( ) , "itemsAmount" ) ; }
GridGroup attributes .
902
protected void registerSpinnerAttributes ( ) { addAttributeProcessor ( new SpinnerArrayLmlAttribute ( ) , "items" ) ; addAttributeProcessor ( new SpinnerDisabledLmlAttribute ( ) , "disabled" , "inputDisabled" ) ; addAttributeProcessor ( new SpinnerNameLmlAttribute ( ) , "selectorName" , "text" ) ; addAttributeProcessor ( new SpinnerPrecisionLmlAttribute ( ) , "precision" , "scale" ) ; addAttributeProcessor ( new SpinnerProgrammaticChangeEventsLmlAttribute ( ) , "programmaticChangeEvents" ) ; addAttributeProcessor ( new SpinnerSelectedLmlAttribute ( ) , "selected" ) ; addAttributeProcessor ( new SpinnerTextFieldEventPolicyLmlAttribute ( ) , "textFieldEventPolicy" ) ; addAttributeProcessor ( new SpinnerWrapLmlAttribute ( ) , "wrap" ) ; }
Spinner attributes .
903
protected void registerValidatorAttributes ( ) { addAttributeProcessor ( new CustomValidatorLmlAttribute ( ) , "validator" , "validate" , "method" , "action" , "check" ) ; addAttributeProcessor ( new ErrorMessageLmlAttribute ( ) , "error" , "errorMsg" , "errorMessage" , "formError" ) ; addAttributeProcessor ( new HideOnEmptyInputLmlAttribute ( ) , "hideOnEmpty" , "hideErrorOnEmpty" ) ; addAttributeProcessor ( new GreaterOrEqualLmlAttribute ( ) , "orEqual" , "allowEqual" , "greaterOrEqual" ) ; addAttributeProcessor ( new GreaterThanLmlAttribute ( ) , "value" , "min" , "greaterThan" ) ; addAttributeProcessor ( new LesserOrEqualLmlAttribute ( ) , "orEqual" , "allowEqual" , "lesserOrEqual" ) ; addAttributeProcessor ( new LesserThanLmlAttribute ( ) , "value" , "max" , "lesserThan" ) ; addAttributeProcessor ( new FormSuccessMessageLmlAttribute ( ) , "success" , "successMsg" , "successMessage" ) ; addAttributeProcessor ( new TreatDisabledFieldsAsValidLmlAttribute ( ) , "treatDisabledFieldsAsValid" , "disabledValid" ) ; addAttributeProcessor ( new DisableOnFormErrorLmlAttribute ( ) , "disableOnError" , "disableOnFormError" , "formDisable" ) ; addAttributeProcessor ( new ErrorMessageLabelLmlAttribute ( ) , "errorMessage" , "errorLabel" , "errorMsgLabel" , "errorMessageLabel" ) ; addAttributeProcessor ( new RequireCheckedLmlAttribute ( ) , "requireChecked" , "formChecked" , "notCheckedError" , "uncheckedError" ) ; addAttributeProcessor ( new RequireUncheckedLmlAttribute ( ) , "requireUnchecked" , "requireNotChecked" , "formUnchecked" , "checkedError" ) ; }
InputValidator implementations attributes .
904
@ Initiate ( priority = AutumnActionPriority . TOP_PRIORITY ) public void initiateSkin ( final SkinService skinService ) { VisUI . load ( VisUI . SkinScale . X2 ) ; skinService . addSkin ( "default" , VisUI . getSkin ( ) ) ; InterfaceService . DEFAULT_VIEW_RESIZER = new StandardViewResizer ( ) ; }
This action will be invoked when the application is being initialized . Actions are sorted by their priority and invoked in descending order ; by manipulating the priority values you can fully control the flow of your application s initiation .
905
public static String [ ] split ( final CharSequence charSequence , final char separator ) { if ( isEmpty ( charSequence ) ) { return EMPTY_ARRAY ; } final int originalSeparatorsCount = countSeparatedCharAppearances ( charSequence , separator ) ; int separatorsCount = originalSeparatorsCount ; if ( startsWith ( charSequence , separator ) ) { separatorsCount -- ; } if ( charSequence . length ( ) > 1 && endsWith ( charSequence , separator ) ) { separatorsCount -- ; } if ( separatorsCount <= 0 ) { if ( originalSeparatorsCount == 0 ) { return new String [ ] { charSequence . toString ( ) } ; } else if ( isSameChar ( charSequence ) ) { return EMPTY_ARRAY ; } return new String [ ] { removeCharacter ( charSequence . toString ( ) , separator ) } ; } final String [ ] result = new String [ separatorsCount + 1 ] ; int currentResultIndex = 0 ; final StringBuilder builder = new StringBuilder ( ) ; for ( int index = 0 , length = charSequence . length ( ) ; index < length ; index ++ ) { final char character = charSequence . charAt ( index ) ; if ( character == separator ) { if ( isNotEmpty ( builder ) ) { result [ currentResultIndex ++ ] = builder . toString ( ) ; clearBuilder ( builder ) ; } } else { builder . append ( character ) ; } } if ( isNotEmpty ( builder ) ) { result [ currentResultIndex ++ ] = builder . toString ( ) ; } return result ; }
As opposed to string s split this method allows to split a char sequence without a regex provided that the separator is a single character . Since it does not require pattern compiling and is a simple iteration this method should be always preferred when it can be used .
906
public static < Key , Value > Value putIfAbsent ( final ObjectMap < Key , Value > map , final Key key , final Value value ) { if ( ! map . containsKey ( key ) ) { map . put ( key , value ) ; return value ; } return map . get ( key ) ; }
Puts a value with the given key in the passed map provided that the passed key isn t already present in the map .
907
protected String extractPackageName ( final Class < ? > root ) { return root . getName ( ) . substring ( 0 , root . getName ( ) . length ( ) - root . getSimpleName ( ) . length ( ) - 1 ) ; }
GWT - friendly method that extracts name of the package from class .
908
protected String getPackageName ( final Class < ? > root ) { return root . getName ( ) . substring ( 0 , root . getName ( ) . length ( ) - root . getSimpleName ( ) . length ( ) - 1 ) ; }
GWT - friendly way of extracting package name .
909
void ensureCapacity ( final int bytesAmount ) { if ( currentByteArrayIndex + bytesAmount >= serializedData . length ) { int newSerializedDataArrayLength = ( serializedData . length + 1 ) * 2 ; while ( currentByteArrayIndex + bytesAmount >= newSerializedDataArrayLength ) { newSerializedDataArrayLength = newSerializedDataArrayLength * 2 ; } final byte [ ] newSerializedDataArray = new byte [ newSerializedDataArrayLength ] ; System . arraycopy ( serializedData , 0 , newSerializedDataArray , 0 , currentByteArrayIndex ) ; serializedData = newSerializedDataArray ; } }
Resizes original byte array if the object turns out to be bigger than expected .
910
public byte [ ] serialize ( ) { if ( currentByteArrayIndex == 0 ) { return new byte [ 0 ] ; } final byte [ ] extractedSerializedData = new byte [ currentByteArrayIndex ] ; System . arraycopy ( serializedData , 0 , extractedSerializedData , 0 , currentByteArrayIndex ) ; return extractedSerializedData ; }
Finishes serialization returning the object as a byte array .
911
public static < Type > void processAttributes ( final Type widget , final LmlTag tag , final LmlParser parser , final ObjectSet < String > processedAttributes , final boolean throwExceptionIfAttributeUnknown ) { if ( GdxMaps . isEmpty ( tag . getNamedAttributes ( ) ) ) { return ; } final LmlSyntax syntax = parser . getSyntax ( ) ; final boolean hasProcessedAttributes = processedAttributes != null ; for ( final Entry < String , String > attribute : tag . getNamedAttributes ( ) ) { if ( attribute == null || hasProcessedAttributes && processedAttributes . contains ( attribute . key ) ) { continue ; } final LmlAttribute < Type > attributeProcessor = syntax . getAttributeProcessor ( widget , attribute . key ) ; if ( attributeProcessor == null ) { if ( throwExceptionIfAttributeUnknown ) { parser . throwErrorIfStrict ( "Unknown attribute: \"" + attribute . key + "\" for widget type: " + widget . getClass ( ) . getName ( ) ) ; } continue ; } attributeProcessor . process ( parser , tag , widget , attribute . value ) ; if ( hasProcessedAttributes ) { processedAttributes . add ( attribute . key ) ; } } }
Utility method that processes all named attributes of the selected type .
912
public void validateRange ( final LmlParser parser ) { if ( min >= max || stepSize > max - min || value < min || value > max || stepSize <= 0f ) { parser . throwError ( "Range widget not properly constructed. Min value has to be lower than max and step size cannot be higher than the difference between min and max values. Initial value cannot be lower than min or higher than max value. Step size cannot be zero or negative." ) ; } }
MUST be called before using range s numeric values .
913
public void addViewActionContainer ( final String actionContainerId , final ActionContainer actionContainer ) { parser . getData ( ) . addActionContainer ( actionContainerId , actionContainer ) ; }
Registers an action container globally for all views .
914
public void addViewAction ( final String actionId , final ActorConsumer < ? , ? > action ) { parser . getData ( ) . addActorConsumer ( actionId , action ) ; }
Registers an action globally for all views .
915
public void registerController ( final Class < ? > mappedControllerClass , final ViewController controller ) { controllers . put ( mappedControllerClass , controller ) ; if ( Strings . isNotEmpty ( controller . getViewId ( ) ) ) { parser . getData ( ) . addActorConsumer ( SCREEN_TRANSITION_ACTION_PREFIX + controller . getViewId ( ) , new ScreenTransitionAction ( this , mappedControllerClass ) ) ; } }
Allows to manually register a managed controller . For internal use mostly .
916
public void showDialog ( final Class < ? > dialogControllerClass ) { if ( currentController != null ) { dialogControllers . get ( dialogControllerClass ) . show ( currentController . getStage ( ) ) ; } }
Allows to show a globally registered dialog .
917
public void initiateAllControllers ( ) { for ( final ViewController controller : controllers . values ( ) ) { initiateView ( controller ) ; } for ( final ViewDialogController controller : dialogControllers . values ( ) ) { if ( controller instanceof AnnotatedViewDialogController ) { final AnnotatedViewDialogController dialogController = ( AnnotatedViewDialogController ) controller ; if ( ! dialogController . isInitiated ( ) && dialogController . isCachingInstance ( ) ) { dialogController . prepareDialogInstance ( ) ; } } } }
Forces eager initiation of all views managed by registered controllers . Initiates dialogs that cache and reuse their dialog actor instance .
918
public void reload ( ) { currentController . hide ( Actions . sequence ( hidingActionProvider . provideAction ( currentController , currentController ) , Actions . run ( CommonActionRunnables . getActionPosterRunnable ( getViewReloadingRunnable ( ) ) ) ) ) ; }
Hides current view destroys all screens and shows the recreated current view . Note that it won t recreate all views that were previously initiated as views are constructed on demand .
919
public void resize ( final int width , final int height ) { if ( currentController != null ) { currentController . resize ( width , height ) ; } messageDispatcher . postMessage ( AutumnMessage . GAME_RESIZED ) ; }
Resizes the current view if present .
920
public Value get ( final Key key , final Value defaultValue ) { return super . get ( key , defaultValue ) ; }
LazyObjectMap initiates values on access . No need for default values as nulls are impossible as long as the provided is correctly implemented and nulls are not put into the map .
921
public void setMusicVolumeFromPreferences ( final String preferences , final String preferenceName , final float defaultValue ) { musicPreferences = preferences ; musicVolumePreferenceName = preferenceName ; setMusicVolume ( readFromPreferences ( preferences , preferenceName , defaultValue ) ) ; }
Sets the current music volume according to the values stored in preferences . Mostly for internal use .
922
public void setMusicEnabledFromPreferences ( final String preferences , final String preferenceName , final boolean defaultValue ) { musicPreferences = preferences ; musicEnabledPreferenceName = preferenceName ; setMusicEnabled ( readFromPreferences ( preferences , preferenceName , defaultValue ) ) ; }
Sets the current music state according to the value stored in preferences . Mostly for internal use .
923
public void setSoundEnabledFromPreferences ( final String preferences , final String preferenceName , final boolean defaultValue ) { musicPreferences = preferences ; soundEnabledPreferenceName = preferenceName ; setSoundEnabled ( readFromPreferences ( preferences , preferenceName , defaultValue ) ) ; }
Sets the current sound state according to the value stored in preferences . Mostly for internal use .
924
public void setSoundVolumeFromPreferences ( final String preferences , final String preferenceName , final float defaultValue ) { musicPreferences = preferences ; soundVolumePreferenceName = preferenceName ; setSoundVolume ( readFromPreferences ( preferences , preferenceName , defaultValue ) ) ; }
Sets the current sound volume according to the values stored in preferences . Mostly for internal use .
925
public void saveMusicPreferences ( final boolean flush ) { if ( Strings . isNotEmpty ( musicPreferences ) ) { if ( Strings . isNotEmpty ( musicVolumePreferenceName ) ) { saveInPreferences ( musicPreferences , musicVolumePreferenceName , musicVolume ) ; } if ( Strings . isNotEmpty ( musicEnabledPreferenceName ) ) { saveInPreferences ( musicPreferences , musicEnabledPreferenceName , musicEnabled ) ; } if ( flush ) { flushPreferences ( ) ; } } }
Saves music volume and state in preferences .
926
public void saveSoundPreferences ( final boolean flush ) { if ( Strings . isNotEmpty ( musicPreferences ) ) { if ( Strings . isNotEmpty ( soundVolumePreferenceName ) ) { saveInPreferences ( musicPreferences , soundVolumePreferenceName , soundVolume ) ; } if ( Strings . isNotEmpty ( soundEnabledPreferenceName ) ) { saveInPreferences ( musicPreferences , soundEnabledPreferenceName , soundEnabled ) ; } if ( flush ) { flushPreferences ( ) ; } } }
Saves sound volume and state in preferences .
927
private Set < JType > findReflectedClasses ( final GeneratorContext context , final TypeOracle typeOracle , final TreeLogger logger ) throws UnableToCompleteException { final Set < JType > types = new HashSet < JType > ( ) ; final JPackage [ ] packages = typeOracle . getPackages ( ) ; for ( final JPackage jPackage : packages ) { for ( final JClassType jType : jPackage . getTypes ( ) ) { gatherTypes ( jType . getErasedType ( ) , types , context , logger ) ; } } try { final ConfigurationProperty reflectionProperties = context . getPropertyOracle ( ) . getConfigurationProperty ( "gdx.reflect.include" ) ; for ( final String property : reflectionProperties . getValues ( ) ) { final JClassType type = typeOracle . findType ( property ) ; if ( type != null ) { gatherTypes ( type . getErasedType ( ) , types , context , logger ) ; } } } catch ( final BadPropertyValueException exception ) { logger . log ( Type . ERROR , "Unknown property: " + "gdx.reflect.include" , exception ) ; throw new UnableToCompleteException ( ) ; } gatherTypes ( typeOracle . findType ( "java.util.List" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.util.ArrayList" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.util.HashMap" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.util.Map" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.String" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Boolean" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Byte" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Long" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Character" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Short" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Integer" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Float" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.CharSequence" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Double" ) . getErasedType ( ) , types , context , logger ) ; gatherTypes ( typeOracle . findType ( "java.lang.Object" ) . getErasedType ( ) , types , context , logger ) ; return types ; }
LibGDX code goes here . Slightly modified refactored and without unnecessary operations .
928
protected Array < Actor > parse ( ) { actors = GdxArrays . newArray ( Actor . class ) ; invokePreListeners ( actors ) ; final StringBuilder builder = new StringBuilder ( ) ; while ( templateReader . hasNextCharacter ( ) ) { final char character = templateReader . nextCharacter ( ) ; if ( character == syntax . getArgumentOpening ( ) ) { processArgument ( ) ; } else if ( character == syntax . getTagOpening ( ) ) { if ( isNextCharacterCommentOpening ( ) ) { processComment ( ) ; continue ; } if ( currentParentTag != null ) { currentParentTag . handleDataBetweenTags ( builder ) ; } Strings . clearBuilder ( builder ) ; processTag ( builder ) ; } else { builder . append ( character ) ; } } if ( currentParentTag != null ) { throwError ( '"' + currentParentTag . getTagName ( ) + "\" tag was never closed." ) ; } invokePortListeners ( actors ) ; return actors ; }
Does the actual parsing
929
private void processArgument ( ) { final StringBuilder argumentBuilder = new StringBuilder ( ) ; while ( templateReader . hasNextCharacter ( ) ) { final char argumentCharacter = templateReader . nextCharacter ( ) ; if ( argumentCharacter == syntax . getArgumentClosing ( ) ) { final String argument = argumentBuilder . toString ( ) . trim ( ) ; if ( Strings . startsWith ( argument , syntax . getEquationMarker ( ) ) ) { final String equation = LmlUtilities . stripMarker ( argument ) ; templateReader . append ( newEquation ( ) . getResult ( equation ) , equation + " equation" ) ; } else if ( Strings . startsWith ( argument , syntax . getConditionMarker ( ) ) ) { processConditionArgument ( argument , argumentBuilder ) ; } else { templateReader . append ( Nullables . toString ( data . getArgument ( argument ) ) , argument + " argument" ) ; } return ; } argumentBuilder . append ( argumentCharacter ) ; } }
Found an argument opening sign . Have to find argument s name and replace it in the template .
930
private void processComment ( ) { templateReader . nextCharacter ( ) ; if ( templateReader . startsWith ( syntax . getDocumentTypeOpening ( ) ) ) { processSchemaComment ( ) ; return ; } else if ( nestedComments ) { processNestedComment ( ) ; return ; } while ( templateReader . hasNextCharacter ( ) ) { final char commentCharacter = templateReader . nextCharacter ( ) ; if ( isCommentClosingMarker ( commentCharacter ) && templateReader . hasNextCharacter ( ) && templateReader . peekCharacter ( ) == syntax . getTagClosing ( ) ) { templateReader . nextCharacter ( ) ; break ; } } }
Found an open tag starting with comment sign . Burning through characters up to the comment s end .
931
private void processSchemaComment ( ) { burnCharacters ( syntax . getDocumentTypeOpening ( ) . length ( ) ) ; int tagsOpened = 1 ; while ( templateReader . hasNextCharacter ( ) ) { final char character = templateReader . nextCharacter ( ) ; if ( character == syntax . getTagOpening ( ) ) { tagsOpened ++ ; } else if ( character == syntax . getTagClosing ( ) ) { if ( -- tagsOpened == 0 ) { break ; } } } }
Found a comment starting with DOCTYPE . Burning through the characters .
932
private void processNestedComment ( ) { int nestedCommentsAmount = 1 ; while ( templateReader . hasNextCharacter ( ) ) { final char commentCharacter = templateReader . nextCharacter ( ) ; if ( isCommentClosingMarker ( commentCharacter ) && templateReader . hasNextCharacter ( ) && templateReader . peekCharacter ( ) == syntax . getTagClosing ( ) ) { templateReader . nextCharacter ( ) ; if ( -- nestedCommentsAmount == 0 ) { break ; } } if ( commentCharacter == syntax . getTagOpening ( ) && templateReader . hasNextCharacter ( ) && isCommentOpeningMarker ( templateReader . peekCharacter ( ) ) ) { templateReader . nextCharacter ( ) ; nestedCommentsAmount ++ ; } } }
Found an open tag starting with comment sign and nested comments are on . Burning through characters up to the comment s end honoring nested commented - out comments .
933
private void processTag ( final StringBuilder builder ) { boolean started = false ; while ( templateReader . hasNextCharacter ( ) ) { final char tagCharacter = templateReader . nextCharacter ( ) ; if ( ! started && Strings . isWhitespace ( tagCharacter ) ) { continue ; } started = true ; if ( tagCharacter == syntax . getArgumentOpening ( ) ) { processArgument ( ) ; } else if ( tagCharacter == syntax . getTagOpening ( ) && isNextCharacterCommentOpening ( ) ) { processComment ( ) ; } else if ( tagCharacter == syntax . getTagClosing ( ) ) { processTagEntity ( builder ) ; return ; } else { builder . append ( tagCharacter ) ; } } throwError ( "Unclosed tag: " + builder . toString ( ) ) ; }
Found an open tag that is not a comment . Collecting whole tag data .
934
protected void processForActor ( final LmlParser parser , final LmlTag tag , final Actor actor , final String rawAttributeData ) { parser . throwErrorIfStrict ( "\"" + tag . getTagName ( ) + "\" tag has a table cell attribute, but is not directly in a table. Cannot set table cell attribute value with raw data: " + rawAttributeData + " with attribute processor: " + this ) ; }
This method is called if the actor is not in a cell . It should set the property in the actor itself provided that its correct and can be applied . By default throws an exception if the parser is strict .
935
public boolean onEvent ( final LmlParser parser , final Array < Actor > parsingResult ) { final ObjectMap < String , Actor > actorsByIds = parser . getActorsMappedByIds ( ) ; for ( final String id : ids ) { final Actor actor = actorsByIds . get ( id ) ; if ( actor != null ) { attachListener ( actor ) ; } else if ( ! keep ) { parser . throwErrorIfStrict ( "Unknown ID: '" + id + "'. Cannot attach listener." ) ; } } return keep ; }
Invoked after template parsing . Hooks up the listener to actors registered by attachTo attribute .
936
protected void postCloseEvent ( final WebSocketCloseCode closeCode , final String reason ) { for ( final WebSocketListener listener : listeners ) { if ( listener . onClose ( this , closeCode , reason ) ) { break ; } } }
Listeners will be notified about socket closing .
937
public void resize ( final int width , final int height , final boolean centerCamera ) { stage . getViewport ( ) . update ( width , height , centerCamera ) ; }
Updates stage s viewport .
938
public void fill ( final LmlParser parser ) { this . parser = parser ; for ( final Entry < String , I18NBundle > bundle : bundles ) { parser . getData ( ) . addI18nBundle ( bundle . key , bundle . value ) ; if ( defaultBundle . equals ( bundle . key ) ) { parser . getData ( ) . setDefaultI18nBundle ( bundle . value ) ; } } }
Should be called after bundles are loaded .
939
protected void parseNames ( ) { while ( reader . hasNextCharacter ( ) ) { final char character = next ( ) ; if ( Strings . isWhitespace ( character ) ) { addName ( ) ; continue ; } else if ( character == blockOpening ) { addName ( ) ; break ; } else { builder . append ( character ) ; } } if ( GdxArrays . isEmpty ( tags ) ) { throwException ( "No tag names chosen." ) ; } }
Parses names proceeding styles block .
940
protected void addName ( ) { if ( Strings . isNotEmpty ( builder ) ) { int endOffset = 0 ; if ( Strings . endsWith ( builder , tagSeparator ) ) { endOffset = 1 ; } if ( Strings . startsWith ( builder , inheritanceMarker ) ) { inherits . add ( builder . substring ( 1 , builder . length ( ) - endOffset ) ) ; } else { tags . add ( builder . substring ( 0 , builder . length ( ) - endOffset ) ) ; } Strings . clearBuilder ( builder ) ; } }
Appends tag or inheritance name from the current builder data .
941
protected void parseAttributes ( ) { burnWhitespaces ( ) ; attribute = null ; while ( reader . hasNextCharacter ( ) ) { char character = reader . peekCharacter ( ) ; if ( Strings . isNewLine ( character ) && ( attribute != null || Strings . isNotEmpty ( builder ) ) ) { throwException ( "Expecting line end marker: '" + lineEnd + "'." ) ; } character = next ( ) ; if ( Strings . isNewLine ( character ) && ( attribute != null || Strings . isNotEmpty ( builder ) ) ) { throwException ( "Expecting line end marker: '" + lineEnd + "'." ) ; } else if ( character == blockClosing ) { if ( attribute != null || Strings . isNotEmpty ( builder ) ) { throwException ( "Unexpected tag close." ) ; } return ; } else if ( Strings . isWhitespace ( character ) && attribute == null ) { continue ; } else if ( character == separator && attribute == null ) { addAttributeName ( ) ; continue ; } else if ( character == lineEnd ) { if ( attribute == null ) { throwException ( "Found unexpected line end marker: '" + lineEnd + "'. Is separator (" + separator + ") missing?" ) ; } addAttribute ( ) ; } else { builder . append ( character ) ; } } }
Parses attributes block .
942
protected void addAttributeName ( ) { if ( Strings . isNotEmpty ( builder ) ) { attribute = builder . toString ( ) ; Strings . clearBuilder ( builder ) ; } }
Caches currently parsed attribute name .
943
protected void addAttribute ( ) { attributes . put ( attribute , builder . toString ( ) . trim ( ) ) ; attribute = null ; Strings . clearBuilder ( builder ) ; }
Clears attribute cache adds default attribute value .
944
protected void processAttributes ( ) { for ( final String tag : tags ) { for ( final String inherit : inherits ) { styleSheet . addStyles ( tag , styleSheet . getStyles ( inherit ) ) ; } styleSheet . addStyles ( tag , attributes ) ; } }
Adds the stored attribute values to the style sheet . Resolves inherited styles .
945
protected void burnWhitespaces ( ) { while ( reader . hasNextCharacter ( ) ) { final char character = reader . peekCharacter ( ) ; if ( Strings . isWhitespace ( character ) || character == commentMarker && reader . hasNextCharacter ( 1 ) && reader . peekCharacter ( 1 ) == commentSecondary ) { next ( ) ; } else { return ; } } }
Analyzes characters raising the index . Stops after encountering first non - whitespace character .
946
public void reset ( ) { attribute = null ; tags . clear ( ) ; inherits . clear ( ) ; attributes . clear ( ) ; Strings . clearBuilder ( builder ) ; }
Clears control variables .
947
public static void addActors ( final Stage stage , final Iterable < Actor > actors ) { if ( actors != null ) { for ( final Actor actor : actors ) { stage . addActor ( actor ) ; } } }
Null - safe utility for adding multiple actors to the stage .
948
public static void centerActor ( final Actor actor , final Stage stage ) { if ( actor != null && stage != null ) { actor . setPosition ( ( int ) ( stage . getWidth ( ) / 2f - actor . getWidth ( ) / 2f ) , ( int ) ( stage . getHeight ( ) / 2f - actor . getHeight ( ) / 2f ) ) ; } }
Null - safe position update .
949
public static void setKeyboardFocus ( final Actor actor ) { if ( actor != null && actor . getStage ( ) != null ) { actor . getStage ( ) . setKeyboardFocus ( actor ) ; } }
Null - safe method for setting keyboard focus .
950
protected void appendSequence ( final CharSequence sequence , final String name ) { if ( Strings . isNotEmpty ( sequence ) ) { queueCurrentSequence ( ) ; setCurrentSequence ( new CharSequenceEntry ( sequence , name ) ) ; } }
Actual appending method referenced by all others .
951
@ Initiate ( priority = AutumnActionPriority . HIGH_PRIORITY ) private void parseMacros ( ) { if ( GdxArrays . isEmpty ( macros ) ) { return ; } final LmlParser parser = interfaceService . get ( ) . getParser ( ) ; for ( final FileHandle macro : macros ) { parser . parseTemplate ( macro ) ; } }
Parses all collected macros one by one .
952
protected void fadeOutCurrentTheme ( ) { if ( currentTheme != null && currentTheme . isPlaying ( ) ) { currentTheme . setOnCompletionListener ( null ) ; stage . addAction ( Actions . sequence ( VolumeAction . setVolume ( currentTheme , currentTheme . getVolume ( ) , 0f , duration , Interpolation . fade ) , MusicStopAction . stop ( currentTheme ) ) ) ; } currentTheme = null ; }
Smoothly fades out current theme .
953
protected void fadeInCurrentTheme ( ) { if ( currentTheme != null ) { currentTheme . setLooping ( false ) ; currentTheme . setVolume ( 0f ) ; currentTheme . setOnCompletionListener ( listener ) ; stage . addAction ( VolumeAction . setVolume ( currentTheme , 0f , musicVolume . getPercent ( ) , duration , Interpolation . fade ) ) ; currentTheme . play ( ) ; } }
Smoothly fades in current theme .
954
protected void changeTheme ( ) { currentTheme = getNextTheme ( currentTheme ) ; if ( currentTheme != null ) { currentTheme . setLooping ( false ) ; currentTheme . setOnCompletionListener ( listener ) ; currentTheme . setVolume ( musicVolume . getPercent ( ) ) ; currentTheme . play ( ) ; } }
Forces a change of current theme . Assumes a theme was already played - there are no smooth fade ins of any kind .
955
public static void clearScreen ( final float r , final float g , final float b ) { Gdx . gl . glClearColor ( r , g , b , 1f ) ; Gdx . gl . glClear ( GL20 . GL_COLOR_BUFFER_BIT ) ; }
Clears the screen with the selected color .
956
public Object invoke ( ) { try { return Reflection . invokeMethod ( method , methodOwner , parameters ) ; } catch ( final Exception exception ) { throw new GdxRuntimeException ( "Unable to invoke method: " + method . getName ( ) + " of type: " + methodOwner + " with parameters: " + GdxArrays . newArray ( parameters ) , exception ) ; } }
Invokes the stored method with the chosen arguments .
957
public void updateScale ( ) { scaleX = targetPpiX / Gdx . graphics . getPpiX ( ) ; scaleY = targetPpiY / Gdx . graphics . getPpiY ( ) ; }
Forces update of current pixel per unit ratio according to screen density .
958
private void updateWorldSize ( final int screenWidth , final int screenHeight ) { final float width = screenWidth * scaleX ; final float height = screenHeight * scaleY ; final float fitHeight = width / aspectRatio ; if ( fitHeight > height ) { setWorldSize ( height * aspectRatio , height ) ; } else { setWorldSize ( width , fitHeight ) ; } }
Forces update of current world size according to window size . Will try to keep the set aspect ratio .
959
public void setLocale ( final Locale locale ) { if ( ! localePreference . isCurrent ( locale ) ) { setView ( getCurrentView ( ) , new Action ( ) { private boolean reloaded = false ; public boolean act ( final float delta ) { if ( ! reloaded ) { reloaded = true ; localePreference . setLocale ( locale ) ; localePreference . save ( ) ; reloadViews ( ) ; } return true ; } } ) ; } }
Also available as setLocale action in LML views . Will extract locale from actor s ID .
960
protected void addDefaultComponents ( ) { final boolean mapSuper = context . isMapSuperTypes ( ) ; context . setMapSuperTypes ( false ) ; final AssetManagerProvider assetManagerProvider = new AssetManagerProvider ( ) ; context . addProvider ( assetManagerProvider ) ; context . addDestructible ( assetManagerProvider ) ; final InjectingAssetManager assetManager = assetManagerProvider . getAssetManager ( ) ; context . addProvider ( new BitmapFontProvider ( assetManager ) ) ; context . addProvider ( new ModelProvider ( assetManager ) ) ; context . addProvider ( new MusicProvider ( assetManager ) ) ; context . addProvider ( new Particle3dEffectProvider ( assetManager ) ) ; context . addProvider ( new ParticleEffectProvider ( assetManager ) ) ; context . addProvider ( new PixmapProvider ( assetManager ) ) ; context . addProvider ( new SoundProvider ( assetManager ) ) ; context . addProvider ( new TextureAtlasProvider ( assetManager ) ) ; context . addProvider ( new TextureProvider ( assetManager ) ) ; context . addProvider ( new ArrayProvider < Object > ( ) ) ; context . addProvider ( new ListProvider < Object > ( ) ) ; context . addProvider ( new MapProvider < Object , Object > ( ) ) ; context . addProvider ( new SetProvider < Object > ( ) ) ; i18nBundleProvider = new I18NBundleProvider ( assetManager ) ; localePreference = new LocalePreference ( i18nBundleProvider ) ; i18nBundleProvider . setLocalePreference ( localePreference ) ; context . addProvider ( i18nBundleProvider ) ; context . addProperty ( localePreference ) ; context . addProvider ( localePreference ) ; context . addProvider ( new LoggerProvider ( ) ) ; context . addProvider ( new PreferencesProvider ( ) ) ; final SpriteBatchProvider spriteBatchProvider = new SpriteBatchProvider ( ) ; context . addProvider ( new BatchProvider ( spriteBatchProvider ) ) ; context . addProvider ( spriteBatchProvider ) ; context . addDestructible ( spriteBatchProvider ) ; context . addProvider ( new SkinProvider ( assetManager ) ) ; final StageProvider stageProvider = new StageProvider ( spriteBatchProvider . getBatch ( ) ) ; stage = stageProvider . getStage ( ) ; context . addProvider ( stageProvider ) ; if ( includeMusicService ( ) ) { final MusicOnPreference musicOn = new MusicOnPreference ( ) ; final SoundOnPreference soundOn = new SoundOnPreference ( ) ; final MusicVolumePreference musicVolume = new MusicVolumePreference ( ) ; final SoundVolumePreference soundVolume = new SoundVolumePreference ( ) ; context . addProperty ( musicOn ) ; context . addProperty ( soundOn ) ; context . addProperty ( musicVolume ) ; context . addProperty ( soundVolume ) ; context . add ( new MusicService ( stage , musicOn , soundOn , musicVolume , soundVolume ) ) ; } context . setMapSuperTypes ( mapSuper ) ; context . add ( this ) ; }
Registers multiple providers and singletons that produce LibGDX - related object instances .
961
public void clear ( ) { Node < T > node = head . next , next ; size = 0 ; head . reset ( ) ; tail = head ; iterator . currentNode = head ; while ( node != null ) { next = node . next ; node . free ( pool ) ; node = next ; } }
Removes all elements of the list . Frees all nodes to the pool .
962
private void destroyInitializer ( ) { GdxMaps . clearAll ( fieldProcessors , methodProcessors , typeProcessors ) ; GdxArrays . clearAll ( scannedMetaAnnotations , scannedAnnotations , processors , delayedConstructions , manuallyAddedComponents , manuallyAddedProcessors ) ; }
Clears meta - data collections .
963
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void processType ( final Object component , final Context context , final ContextDestroyer contextDestroyer ) { final com . badlogic . gdx . utils . reflect . Annotation [ ] annotations = getAnnotations ( component . getClass ( ) ) ; if ( annotations == null || annotations . length == 0 ) { return ; } for ( final com . badlogic . gdx . utils . reflect . Annotation annotation : annotations ) { if ( typeProcessors . containsKey ( annotation . getAnnotationType ( ) ) ) { final Array < AnnotationProcessor < ? > > typeProcessorsForAnnotation = typeProcessors . get ( annotation . getAnnotationType ( ) ) ; for ( int index = 0 ; index < typeProcessorsForAnnotation . size ; index ++ ) { final AnnotationProcessor processor = typeProcessorsForAnnotation . get ( index ) ; processor . processType ( component . getClass ( ) , annotation . getAnnotation ( annotation . getAnnotationType ( ) ) , component , context , this , contextDestroyer ) ; } } } }
Processes components class annotations .
964
private void processMethods ( final Object component , final Context context , final ContextDestroyer contextDestroyer ) { Class < ? > componentClass = component . getClass ( ) ; while ( componentClass != null && ! componentClass . equals ( Object . class ) ) { final Method [ ] methods = ClassReflection . getDeclaredMethods ( componentClass ) ; if ( methods != null && methods . length > 0 ) { processMethods ( component , methods , context , contextDestroyer ) ; } componentClass = componentClass . getSuperclass ( ) ; } }
Scans class tree of component to process all its methods .
965
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void processMethods ( final Object component , final Method [ ] methods , final Context context , final ContextDestroyer contextDestroyer ) { for ( final Method method : methods ) { final com . badlogic . gdx . utils . reflect . Annotation [ ] annotations = getAnnotations ( method ) ; if ( annotations == null || annotations . length == 0 ) { continue ; } for ( final com . badlogic . gdx . utils . reflect . Annotation annotation : annotations ) { if ( methodProcessors . containsKey ( annotation . getAnnotationType ( ) ) ) { for ( final AnnotationProcessor processor : methodProcessors . get ( annotation . getAnnotationType ( ) ) ) { processor . processMethod ( method , annotation . getAnnotation ( annotation . getAnnotationType ( ) ) , component , context , this , contextDestroyer ) ; } } } } }
Does the actual processing of found methods .
966
private void processFields ( final Object component , final Context context , final ContextDestroyer contextDestroyer ) { Class < ? > componentClass = component . getClass ( ) ; while ( componentClass != null && ! componentClass . equals ( Object . class ) ) { final Field [ ] fields = ClassReflection . getDeclaredFields ( componentClass ) ; if ( fields != null && fields . length > 0 ) { processFields ( component , fields , context , contextDestroyer ) ; } componentClass = componentClass . getSuperclass ( ) ; } }
Scans class tree of component to process all its fields .
967
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private void processFields ( final Object component , final Field [ ] fields , final Context context , final ContextDestroyer contextDestroyer ) { for ( final Field field : fields ) { final com . badlogic . gdx . utils . reflect . Annotation [ ] annotations = getAnnotations ( field ) ; if ( annotations == null || annotations . length == 0 ) { continue ; } for ( final com . badlogic . gdx . utils . reflect . Annotation annotation : annotations ) { if ( fieldProcessors . containsKey ( annotation . getAnnotationType ( ) ) ) { for ( final AnnotationProcessor processor : fieldProcessors . get ( annotation . getAnnotationType ( ) ) ) { processor . processField ( field , annotation . getAnnotation ( annotation . getAnnotationType ( ) ) , component , context , this , contextDestroyer ) ; } } } } }
Does the actual processing of found fields .
968
protected void dispose ( ) { final WebSocket currentWebSocket = webSocket ; if ( currentWebSocket != null && currentWebSocket . isOpen ( ) ) { try { currentWebSocket . disconnect ( WebSocketCloseCode . AWAY . getCode ( ) ) ; } catch ( final Exception exception ) { postErrorEvent ( exception ) ; } } }
Removes current web socket instance .
969
protected void registerActorTags ( ) { addTagProvider ( new ActorLmlTagProvider ( ) , "actor" , "group" ) ; addTagProvider ( new ActorStorageLmlTagProvider ( ) , "actorStorage" , "isolate" ) ; addTagProvider ( new AnimatedImageLmlTagProvider ( ) , "animatedImage" ) ; addTagProvider ( new ButtonGroupLmlTagProvider ( ) , "buttonGroup" , "buttonTable" ) ; addTagProvider ( new ButtonLmlTagProvider ( ) , "button" ) ; addTagProvider ( new CheckBoxLmlTagProvider ( ) , "checkBox" ) ; addTagProvider ( new ContainerLmlTagProvider ( ) , "container" ) ; addTagProvider ( new DialogLmlTagProvider ( ) , "dialog" ) ; addTagProvider ( new HorizontalGroupLmlTagProvider ( ) , "horizontalGroup" ) ; addTagProvider ( new ImageButtonLmlTagProvider ( ) , "imageButton" ) ; addTagProvider ( new ImageLmlTagProvider ( ) , "image" ) ; addTagProvider ( new ImageTextButtonLmlTagProvider ( ) , "imageTextButton" ) ; addTagProvider ( new LabelLmlTagProvider ( ) , "label" ) ; addTagProvider ( new ListLmlTagProvider ( ) , "list" ) ; addTagProvider ( new ProgressBarLmlTagProvider ( ) , "progressBar" ) ; addTagProvider ( new ScrollPaneLmlTagProvider ( ) , "scrollPane" ) ; addTagProvider ( new SelectBoxLmlTagProvider ( ) , "selectBox" ) ; addTagProvider ( new SliderLmlTagProvider ( ) , "slider" ) ; addTagProvider ( new SplitPaneLmlTagProvider ( ) , "splitPane" ) ; addTagProvider ( new StackLmlTagProvider ( ) , "stack" ) ; addTagProvider ( new TableLmlTagProvider ( ) , "table" ) ; addTagProvider ( new TextAreaLmlTagProvider ( ) , "textArea" ) ; addTagProvider ( new TextButtonLmlTagProvider ( ) , "textButton" ) ; addTagProvider ( new TextFieldLmlTagProvider ( ) , "textField" ) ; addTagProvider ( new TooltipLmlTagProvider ( ) , "tooltip" ) ; addTagProvider ( new TouchpadLmlTagProvider ( ) , "touchpad" ) ; addTagProvider ( new TreeLmlTagProvider ( ) , "tree" ) ; addTagProvider ( new VerticalGroupLmlTagProvider ( ) , "verticalGroup" ) ; addTagProvider ( new WindowLmlTagProvider ( ) , "window" ) ; }
Registers actor - based tags that create widgets .
970
protected void registerMacroTags ( ) { addMacroTagProvider ( new ActorLmlMacroTagProvider ( ) , "actor" ) ; addMacroTagProvider ( new AnyNotNullLmlMacroTagProvider ( ) , "anyNotNull" , "any" ) ; addMacroTagProvider ( new ArgumentLmlMacroTagProvider ( ) , "nls" , "argument" , "preference" ) ; addMacroTagProvider ( new ArgumentReplacementLmlMacroTagProvider ( ) , "replace" , "replaceArguments" , "noOp" , "root" ) ; addMacroTagProvider ( new AssignLmlMacroTagProvider ( ) , "assign" , "var" , "val" ) ; addMacroTagProvider ( new CalculationLmlMacroTagProvider ( ) , "calculate" , "calculation" ) ; addMacroTagProvider ( new ChangeListenerLmlMacroTagProvider ( ) , "onChange" , "changeListener" ) ; addMacroTagProvider ( new ClickListenerLmlMacroTagProvider ( ) , "onClick" , "clickListener" ) ; addMacroTagProvider ( new CommentLmlMacroTagProvider ( ) , "comment" , "FIXME" , "TODO" ) ; addMacroTagProvider ( new ConditionalLmlMacroTagProvider ( ) , "if" , "test" , "check" ) ; addMacroTagProvider ( new EvaluateLmlMacroTagProvider ( ) , "eval" , "evaluate" , "invoke" ) ; addMacroTagProvider ( new ExceptionLmlMacroTagProvider ( ) , "exception" , "throw" , "error" ) ; addMacroTagProvider ( new ForEachLmlMacroTagProvider ( ) , "forEach" , "for" , "each" ) ; addMacroTagProvider ( new ImportAbsoluteLmlMacroTagProvider ( ) , "absoluteImport" ) ; addMacroTagProvider ( new ImportClasspathLmlMacroTagProvider ( ) , "classpathImport" ) ; addMacroTagProvider ( new ImportExternallLmlMacroTagProvider ( ) , "externalImport" ) ; addMacroTagProvider ( new ImportInternalLmlMacroTagProvider ( ) , "import" , "internalImport" ) ; addMacroTagProvider ( new ImportLocalLmlMacroTagProvider ( ) , "localImport" ) ; addMacroTagProvider ( new InputListenerLmlMacroTagProvider ( ) , "inputListener" , "onInput" ) ; addMacroTagProvider ( new LoggerDebugLmlMacroTagProvider ( ) , "debug" , "logDebug" , "trace" , "logTrace" ) ; addMacroTagProvider ( new LoggerErrorLmlMacroTagProvider ( ) , "logError" ) ; addMacroTagProvider ( new LoggerInfoLmlMacroTagProvider ( ) , "log" , "logInfo" , "info" ) ; addMacroTagProvider ( new LoopLmlMacroTagProvider ( ) , "loop" , "times" ) ; addMacroTagProvider ( new MetaLmlMacroTagProvider ( ) , "macro" ) ; addMacroTagProvider ( new NestedForEachLmlMacroTagProvider ( ) , "forEachNested" , "nested" , "eachNested" ) ; addMacroTagProvider ( new NewAttributeLmlMacroTagProvider ( ) , "newAttribute" , "attribute" ) ; addMacroTagProvider ( new NewTagLmlMacroTagProvider ( ) , "newTag" , "tag" ) ; addMacroTagProvider ( new NullCheckLmlMacroTagProvider ( ) , "notNull" , "ifNotNull" , "exists" ) ; addMacroTagProvider ( new RandomLmlMacroTagProvider ( ) , "random" ) ; addMacroTagProvider ( new StyleLmlMacroTagProvider ( ) , "style" ) ; addMacroTagProvider ( new StyleSheetImportLmlMacroTagProvider ( ) , "importStyleSheet" ) ; addMacroTagProvider ( new TableCellLmlMacroTagProvider ( ) , "cell" , "tableCell" ) ; addMacroTagProvider ( new TableColumnLmlMacroTagProvider ( ) , "column" , "tableColumn" ) ; addMacroTagProvider ( new TableRowLmlMacroTagProvider ( ) , "row" , "tableRow" ) ; addMacroTagProvider ( new WhileLmlMacroTagProvider ( ) , "while" , "until" ) ; }
Registers macro tags that manipulate templates structures .
971
protected void registerBuildingAttributes ( ) { addBuildingAttributeProcessor ( new SkinLmlAttribute ( ) , "skin" ) ; addBuildingAttributeProcessor ( new StyleLmlAttribute ( ) , "style" , "class" ) ; addBuildingAttributeProcessor ( new OnResultInitialLmlAttribute ( ) , "result" , "onResult" ) ; addBuildingAttributeProcessor ( new ToButtonTableLmlAttribute ( ) , "toButtonTable" ) ; addBuildingAttributeProcessor ( new ToDialogTableLmlAttribute ( ) , "toDialogTable" ) ; addBuildingAttributeProcessor ( new ToTitleTableLmlAttribute ( ) , "toTitleTable" ) ; addBuildingAttributeProcessor ( new TextLmlAttribute ( ) , "text" , "value" ) ; addBuildingAttributeProcessor ( new HorizontalLmlAttribute ( ) , "horizontal" ) ; addBuildingAttributeProcessor ( new VerticalLmlAttribute ( ) , "vertical" ) ; addBuildingAttributeProcessor ( new RangeInitialValueLmlAttribute ( ) , "value" ) ; addBuildingAttributeProcessor ( new RangeMaxValueLmlAttribute ( ) , "max" ) ; addBuildingAttributeProcessor ( new RangeMinValueLmlAttribute ( ) , "min" ) ; addBuildingAttributeProcessor ( new RangeStepSizeLmlAttribute ( ) , "stepSize" , "step" ) ; addBuildingAttributeProcessor ( new TooltipManagerLmlAttribute ( ) , "tooltipManager" ) ; }
Attributes used during widget creation .
972
protected void registerCommonAttributes ( ) { addAttributeProcessor ( new ActionLmlAttribute ( ) , "action" , "onShow" ) ; addAttributeProcessor ( new ColorAlphaLmlAttribute ( ) , "alpha" , "a" ) ; addAttributeProcessor ( new ColorBlueLmlAttribute ( ) , "blue" , "b" ) ; addAttributeProcessor ( new ColorGreenLmlAttribute ( ) , "green" , "g" ) ; addAttributeProcessor ( new ColorLmlAttribute ( ) , "color" ) ; addAttributeProcessor ( new ColorRedLmlAttribute ( ) , "red" , "r" ) ; addAttributeProcessor ( new DebugLmlAttribute ( ) , "debug" ) ; addAttributeProcessor ( new IdLmlAttribute ( ) , "id" ) ; addAttributeProcessor ( new MultilineLmlAttribute ( ) , "multiline" ) ; addAttributeProcessor ( new OnChangeLmlAttribute ( ) , "onChange" , "change" ) ; addAttributeProcessor ( new OnClickLmlAttribute ( ) , "onClick" , "click" ) ; addAttributeProcessor ( new OnCloseLmlAttribute ( ) , "onClose" , "close" , "onTagClose" , "tagClose" ) ; addAttributeProcessor ( new OnCreateLmlAttribute ( ) , "onCreate" , "create" , "onInit" , "init" ) ; addAttributeProcessor ( new RotationLmlAttribute ( ) , "rotation" , "angle" ) ; addAttributeProcessor ( new ScaleLmlAttribute ( ) , "scale" ) ; addAttributeProcessor ( new ScaleXLmlAttribute ( ) , "scaleX" ) ; addAttributeProcessor ( new ScaleYLmlAttribute ( ) , "scaleY" ) ; addAttributeProcessor ( new TooltipLmlAttribute ( ) , "tooltip" ) ; addAttributeProcessor ( new TouchableLmlAttribute ( ) , "touchable" ) ; addAttributeProcessor ( new TreeNodeLmlAttribute ( ) , "node" ) ; addAttributeProcessor ( new VisibleLmlAttribute ( ) , "visible" ) ; addAttributeProcessor ( new XLmlAttribute ( ) , "x" ) ; addAttributeProcessor ( new YLmlAttribute ( ) , "y" ) ; addAttributeProcessor ( new TransformLmlAttribute ( ) , "transform" ) ; addAttributeProcessor ( new DebugRecursivelyLmlAttribute ( ) , "debugRecursively" ) ; addAttributeProcessor ( new FillParentLmlAttribute ( ) , "fillParent" ) ; addAttributeProcessor ( new LayoutEnabledLmlAttribute ( ) , "layout" , "layoutEnabled" ) ; addAttributeProcessor ( new PackLmlAttribute ( ) , "pack" ) ; addAttributeProcessor ( new DisabledLmlAttribute ( ) , "disabled" , "disable" ) ; }
Attributes applied to all actors .
973
protected void registerListenerAttributes ( ) { addAttributeProcessor ( new ConditionLmlAttribute ( ) , "if" ) ; addAttributeProcessor ( new KeepListenerLmlAttribute ( ) , "keep" ) ; addAttributeProcessor ( new ListenerIdsLmlAttribute ( ) , "ids" ) ; addAttributeProcessor ( new CombinedKeysLmlAttribute ( ) , "combined" ) ; addAttributeProcessor ( new ListenerKeysLmlAttribute ( ) , "keys" ) ; }
Listener tags attributes .
974
protected void registerAnimatedImageAttributes ( ) { addAttributeProcessor ( new AnimationDelayLmlAttribute ( ) , "delay" ) ; addAttributeProcessor ( new AnimationMaxDelayLmlAttribute ( ) , "maxDelay" ) ; addAttributeProcessor ( new BackwardsLmlAttribute ( ) , "backwards" ) ; addAttributeProcessor ( new BouncingLmlAttribute ( ) , "bounce" , "bouncing" ) ; addAttributeProcessor ( new CurrentFrameLmlAttribute ( ) , "frame" , "currentFrame" ) ; addAttributeProcessor ( new FramesLmlAttribute ( ) , "frames" ) ; addAttributeProcessor ( new PlayOnceLmlAttribute ( ) , "playOnce" ) ; }
AnimatedImage widget attributes .
975
protected void registerContainerAttributes ( ) { addAttributeProcessor ( new ContainerAdjustPaddingLmlAttribute ( ) , "adjustPadding" ) ; addAttributeProcessor ( new ContainerAlignLmlAttribute ( ) , "align" ) ; addAttributeProcessor ( new ContainerBackgroundLmlAttribute ( ) , "bg" , "background" ) ; addAttributeProcessor ( new ContainerClipLmlAttribute ( ) , "clip" ) ; addAttributeProcessor ( new ContainerFillLmlAttribute ( ) , "fill" ) ; addAttributeProcessor ( new ContainerFillXLmlAttribute ( ) , "fillX" ) ; addAttributeProcessor ( new ContainerFillYLmlAttribute ( ) , "fillY" ) ; addAttributeProcessor ( new ContainerHeightLmlAttribute ( ) , "height" ) ; addAttributeProcessor ( new ContainerMaxHeightLmlAttribute ( ) , "maxHeight" ) ; addAttributeProcessor ( new ContainerMaxSizeLmlAttribute ( ) , "maxSize" ) ; addAttributeProcessor ( new ContainerMaxWidthLmlAttribute ( ) , "maxWidth" ) ; addAttributeProcessor ( new ContainerMinHeightLmlAttribute ( ) , "minHeight" ) ; addAttributeProcessor ( new ContainerMinSizeLmlAttribute ( ) , "minSize" ) ; addAttributeProcessor ( new ContainerMinWidthLmlAttribute ( ) , "minWidth" ) ; addAttributeProcessor ( new ContainerPrefHeightLmlAttribute ( ) , "prefHeight" ) ; addAttributeProcessor ( new ContainerPrefSizeLmlAttribute ( ) , "prefSize" ) ; addAttributeProcessor ( new ContainerPrefWidthLmlAttribute ( ) , "prefWidth" ) ; addAttributeProcessor ( new ContainerRoundLmlAttribute ( ) , "round" ) ; addAttributeProcessor ( new ContainerSizeLmlAttribute ( ) , "size" ) ; addAttributeProcessor ( new ContainerWidthLmlAttribute ( ) , "width" ) ; }
Container widget attributes .
976
protected void registerHorizontalGroupAttributes ( ) { addAttributeProcessor ( new HorizontalGroupAlignmentLmlAttribute ( ) , "groupAlign" ) ; addAttributeProcessor ( new HorizontalGroupFillLmlAttribute ( ) , "groupFill" ) ; addAttributeProcessor ( new HorizontalGroupPaddingBottomLmlAttribute ( ) , "groupPadBottom" ) ; addAttributeProcessor ( new HorizontalGroupPaddingLeftLmlAttribute ( ) , "groupPadLeft" ) ; addAttributeProcessor ( new HorizontalGroupPaddingLmlAttribute ( ) , "groupPad" , "padding" ) ; addAttributeProcessor ( new HorizontalGroupPaddingRightLmlAttribute ( ) , "groupPadRight" ) ; addAttributeProcessor ( new HorizontalGroupPaddingTopLmlAttribute ( ) , "groupPadTop" ) ; addAttributeProcessor ( new HorizontalGroupReverseLmlAttribute ( ) , "reverse" ) ; addAttributeProcessor ( new HorizontalGroupSpacingLmlAttribute ( ) , "groupSpace" , "spacing" ) ; }
HorizontalGroup widget attributes .
977
protected void registerLabelAttributes ( ) { addAttributeProcessor ( new EllipsisLmlAttribute ( ) , "ellipsis" ) ; addAttributeProcessor ( new LabelAlignmentLmlAttribute ( ) , "labelAlign" , "labelAlignment" ) ; addAttributeProcessor ( new LineAlignmentLmlAttribute ( ) , "lineAlign" , "lineAlignment" ) ; addAttributeProcessor ( new TextAlignmentLmlAttribute ( ) , "textAlign" , "textAlignment" ) ; addAttributeProcessor ( new WrapLmlAttribute ( ) , "wrap" ) ; }
Label widget attributes .
978
protected void registerListAttributes ( ) { addAttributeProcessor ( new MultipleLmlAttribute ( ) , "multiple" ) ; addAttributeProcessor ( new RangeSelectLmlAttribute ( ) , "rangeSelect" ) ; addAttributeProcessor ( new RequiredLmlAttribute ( ) , "required" ) ; addAttributeProcessor ( new SelectedLmlAttribute ( ) , "selected" , "select" , "value" ) ; addAttributeProcessor ( new SelectionDisabledLmlAttribute ( ) , "disabled" , "disable" ) ; addAttributeProcessor ( new ToggleLmlAttribute ( ) , "toggle" ) ; }
List widget attributes .
979
protected void registerScrollBarAttributes ( ) { addAttributeProcessor ( new ScrollBarsOnTopLmlAttribute ( ) , "barsOnTop" , "scrollbarsOnTop" ) ; addAttributeProcessor ( new ScrollBarsPositionsLmlAttribute ( ) , "barsPositions" , "scrollBarsPositions" ) ; addAttributeProcessor ( new ScrollCancelTouchFocusLmlAttribute ( ) , "cancelTouchFocus" ) ; addAttributeProcessor ( new ScrollClampLmlAttribute ( ) , "clamp" ) ; addAttributeProcessor ( new ScrollDisabledLmlAttribute ( ) , "disable" , "disabled" , "scrollingDisabled" ) ; addAttributeProcessor ( new ScrollDisabledXLmlAttribute ( ) , "disableX" , "disabledX" , "scrollingDisabledX" ) ; addAttributeProcessor ( new ScrollDisabledYLmlAttribute ( ) , "disableY" , "disabledY" , "scrollingDisabledY" ) ; addAttributeProcessor ( new ScrollFadeBarsLmlAttribute ( ) , "fadeBars" , "fadeScrollbars" ) ; addAttributeProcessor ( new ScrollFadeBarsSetupLmlAttribute ( ) , "setupFadeScrollBars" ) ; addAttributeProcessor ( new ScrollFlickLmlAttribute ( ) , "flick" , "flickScroll" ) ; addAttributeProcessor ( new ScrollFlickTapSquareSizeLmlAttribute ( ) , "flickScrollTapSquareSize" , "tapSquareSize" ) ; addAttributeProcessor ( new ScrollFlingTimeLmlAttribute ( ) , "flingTime" ) ; addAttributeProcessor ( new ScrollForceLmlAttribute ( ) , "force" , "forceScroll" ) ; addAttributeProcessor ( new ScrollForceXLmlAttribute ( ) , "forceX" , "forceScrollX" ) ; addAttributeProcessor ( new ScrollForceYLmlAttribute ( ) , "forceY" , "forceScrollY" ) ; addAttributeProcessor ( new ScrollOverscrollLmlAttribute ( ) , "overscroll" ) ; addAttributeProcessor ( new ScrollOverscrollSetupLmlAttribute ( ) , "setupOverscroll" ) ; addAttributeProcessor ( new ScrollOverscrollXLmlAttribute ( ) , "overscrollX" ) ; addAttributeProcessor ( new ScrollOverscrollYLmlAttribute ( ) , "overscrollY" ) ; addAttributeProcessor ( new ScrollPercentLmlAttribute ( ) , "scrollPercent" , "percent" ) ; addAttributeProcessor ( new ScrollPercentXLmlAttribute ( ) , "scrollPercentX" , "percentX" ) ; addAttributeProcessor ( new ScrollPercentYLmlAttribute ( ) , "scrollPercentY" , "percentY" ) ; addAttributeProcessor ( new ScrollVariableSizeKnobsLmlAttribute ( ) , "variableSizeKnobs" ) ; addAttributeProcessor ( new ScrollSmoothLmlAttribute ( ) , "smooth" , "smoothScrolling" ) ; addAttributeProcessor ( new ScrollVelocityLmlAttribute ( ) , "velocity" ) ; addAttributeProcessor ( new ScrollVelocityXLmlAttribute ( ) , "velocityX" ) ; addAttributeProcessor ( new ScrollVelocityYLmlAttribute ( ) , "velocityY" ) ; }
ScrollBar widget attributes .
980
protected void registerTableAttributes ( ) { addAttributeProcessor ( new OneColumnLmlAttribute ( ) , "oneColumn" ) ; addAttributeProcessor ( new TableAlignLmlAttribute ( ) , "tableAlign" ) ; addAttributeProcessor ( new TableBackgroundLmlAttribute ( ) , "bg" , "background" ) ; addAttributeProcessor ( new TablePadBottomLmlAttribute ( ) , "tablePadBottom" ) ; addAttributeProcessor ( new TablePadLeftLmlAttribute ( ) , "tablePadLeft" ) ; addAttributeProcessor ( new TablePadLmlAttribute ( ) , "tablePad" ) ; addAttributeProcessor ( new TablePadRightLmlAttribute ( ) , "tablePadRight" ) ; addAttributeProcessor ( new TablePadTopLmlAttribute ( ) , "tablePadTop" ) ; addAttributeProcessor ( new TableRoundLmlAttribute ( ) , "round" ) ; registerCellAttributes ( ) ; }
Table widget attributes .
981
protected void registerCellAttributes ( ) { addCellAttributeProcessor ( new CellAlignLmlAttribute ( ) , "align" ) ; addCellAttributeProcessor ( new CellColspanLmlAttribute ( ) , "colspan" ) ; addCellAttributeProcessor ( new CellExpandLmlAttribute ( ) , "expand" ) ; addCellAttributeProcessor ( new CellExpandXLmlAttribute ( ) , "expandX" ) ; addCellAttributeProcessor ( new CellExpandYLmlAttribute ( ) , "expandY" ) ; addCellAttributeProcessor ( new CellFillLmlAttribute ( ) , "fill" ) ; addCellAttributeProcessor ( new CellFillXLmlAttribute ( ) , "fillX" ) ; addCellAttributeProcessor ( new CellFillYLmlAttribute ( ) , "fillY" ) ; addCellAttributeProcessor ( new CellGrowLmlAttribute ( ) , "grow" ) ; addCellAttributeProcessor ( new CellGrowXLmlAttribute ( ) , "growX" ) ; addCellAttributeProcessor ( new CellGrowYLmlAttribute ( ) , "growY" ) ; addCellAttributeProcessor ( new CellHeightLmlAttribute ( ) , "height" ) ; addCellAttributeProcessor ( new CellMaxHeightLmlAttribute ( ) , "maxHeight" ) ; addCellAttributeProcessor ( new CellMaxSizeLmlAttribute ( ) , "maxSize" ) ; addCellAttributeProcessor ( new CellMaxWidthLmlAttribute ( ) , "maxWidth" ) ; addCellAttributeProcessor ( new CellMinHeightLmlAttribute ( ) , "minHeight" ) ; addCellAttributeProcessor ( new CellMinSizeLmlAttribute ( ) , "minSize" ) ; addCellAttributeProcessor ( new CellMinWidthLmlAttribute ( ) , "minWidth" ) ; addCellAttributeProcessor ( new CellPadBottomLmlAttribute ( ) , "padBottom" ) ; addCellAttributeProcessor ( new CellPadLeftLmlAttribute ( ) , "padLeft" ) ; addCellAttributeProcessor ( new CellPadLmlAttribute ( ) , "pad" ) ; addCellAttributeProcessor ( new CellPadRightLmlAttribute ( ) , "padRight" ) ; addCellAttributeProcessor ( new CellPadTopLmlAttribute ( ) , "padTop" ) ; addCellAttributeProcessor ( new CellPrefHeightLmlAttribute ( ) , "prefHeight" ) ; addCellAttributeProcessor ( new CellPrefSizeLmlAttribute ( ) , "prefSize" ) ; addCellAttributeProcessor ( new CellPrefWidthLmlAttribute ( ) , "prefWidth" ) ; addCellAttributeProcessor ( new CellSizeLmlAttribute ( ) , "size" ) ; addCellAttributeProcessor ( new CellSpaceBottomLmlAttribute ( ) , "spaceBottom" ) ; addCellAttributeProcessor ( new CellSpaceLeftLmlAttribute ( ) , "spaceLeft" ) ; addCellAttributeProcessor ( new CellSpaceLmlAttribute ( ) , "space" ) ; addCellAttributeProcessor ( new CellSpaceRightLmlAttribute ( ) , "spaceRight" ) ; addCellAttributeProcessor ( new CellSpaceTopLmlAttribute ( ) , "spaceTop" ) ; addCellAttributeProcessor ( new CellUniformLmlAttribute ( ) , "uniform" ) ; addCellAttributeProcessor ( new CellUniformXLmlAttribute ( ) , "uniformX" ) ; addCellAttributeProcessor ( new CellUniformYLmlAttribute ( ) , "uniformY" ) ; addCellAttributeProcessor ( new CellWidthLmlAttribute ( ) , "width" ) ; addAttributeProcessor ( new RowLmlAttribute ( ) , "row" ) ; }
Attributes available to children tags of a Table parent .
982
protected void registerTextFieldAttributes ( ) { addAttributeProcessor ( new BlinkTimeLmlAttribute ( ) , "blink" , "blinkTime" ) ; addAttributeProcessor ( new CursorLmlAttribute ( ) , "cursor" , "cursorPosition" ) ; addAttributeProcessor ( new DigitsOnlyLmlAttribute ( ) , "digitsOnly" , "numeric" ) ; addAttributeProcessor ( new InputAlignLmlAttribute ( ) , "textAlign" , "inputAlign" , "textAlignment" ) ; addAttributeProcessor ( new MaxLengthLmlAttribute ( ) , "max" , "maxLength" ) ; addAttributeProcessor ( new MessageLmlAttribute ( ) , "message" , "messageText" ) ; addAttributeProcessor ( new PasswordCharacterLmlAttribute ( ) , "passwordCharacter" , "passwordChar" ) ; addAttributeProcessor ( new PasswordModeLmlAttribute ( ) , "passwordMode" , "password" ) ; addAttributeProcessor ( new SelectAllLmlAttribute ( ) , "selectAll" ) ; addAttributeProcessor ( new TextFieldFilterLmlAttribute ( ) , "filter" , "textFilter" , "textFieldFilter" ) ; addAttributeProcessor ( new TextFieldListenerLmlAttribute ( ) , "listener" , "textListener" , "textFieldListener" ) ; addAttributeProcessor ( new PrefRowsLmlAttribute ( ) , "prefRows" , "prefRowsAmount" ) ; }
TextField widget attributes .
983
protected void registerVerticalGroupAttributes ( ) { addAttributeProcessor ( new VerticalGroupAlignmentLmlAttribute ( ) , "groupAlign" ) ; addAttributeProcessor ( new VerticalGroupFillLmlAttribute ( ) , "groupFill" ) ; addAttributeProcessor ( new VerticalGroupPaddingBottomLmlAttribute ( ) , "groupPadBottom" ) ; addAttributeProcessor ( new VerticalGroupPaddingLeftLmlAttribute ( ) , "groupPadLeft" ) ; addAttributeProcessor ( new VerticalGroupPaddingLmlAttribute ( ) , "groupPad" , "padding" ) ; addAttributeProcessor ( new VerticalGroupPaddingRightLmlAttribute ( ) , "groupPadRight" ) ; addAttributeProcessor ( new VerticalGroupPaddingTopLmlAttribute ( ) , "groupPadTop" ) ; addAttributeProcessor ( new VerticalGroupReverseLmlAttribute ( ) , "reverse" ) ; addAttributeProcessor ( new VerticalGroupSpacingLmlAttribute ( ) , "groupSpace" , "spacing" ) ; }
VerticalGroup widget attributes .
984
protected void registerWindowAttributes ( ) { addAttributeProcessor ( new KeepWithinStageLmlAttribute ( ) , "keepWithinStage" , "keepWithin" ) ; addAttributeProcessor ( new ModalLmlAttribute ( ) , "modal" ) ; addAttributeProcessor ( new MovableLmlAttribute ( ) , "movable" ) ; addAttributeProcessor ( new ResizeableLmlAttribute ( ) , "resizeable" , "resizable" ) ; addAttributeProcessor ( new ResizeBorderLmlAttribute ( ) , "resizeBorder" , "border" ) ; addAttributeProcessor ( new TitleAlignmentLmlAttribute ( ) , "titleAlign" , "titleAlignment" ) ; addAttributeProcessor ( new TitleLmlAttribute ( ) , "title" ) ; }
Window widget attributes .
985
public static < Type extends Annotation > Type getAnnotation ( final Field field , final Class < Type > annotationType ) { if ( isAnnotationPresent ( field , annotationType ) ) { return field . getDeclaredAnnotation ( annotationType ) . getAnnotation ( annotationType ) ; } return null ; }
Utility method that allows to extract actual annotation from field bypassing LibGDX annotation wrapper . Returns null if annotation is not present .
986
public static < Type extends Annotation > Type getAnnotation ( final Class < ? > fromClass , final Class < Type > annotationType ) { if ( ClassReflection . isAnnotationPresent ( fromClass , annotationType ) ) { return ClassReflection . getDeclaredAnnotation ( fromClass , annotationType ) . getAnnotation ( annotationType ) ; } return null ; }
Utility method that allows to extract actual annotation from class bypassing LibGDX annotation wrapper . Returns null if annotation is not present .
987
public static < Type extends Annotation > Type getAnnotation ( final Method method , final Class < Type > annotationType ) { if ( isAnnotationPresent ( method , annotationType ) ) { return method . getDeclaredAnnotation ( annotationType ) . getAnnotation ( annotationType ) ; } return null ; }
Utility method that allows to extract actual annotation from method bypassing LibGDX annotation wrapper . Returns null if annotation is not present .
988
public void show ( ) { final Stage stage = getStage ( ) ; stage . getRoot ( ) . clearChildren ( ) ; LmlUtilities . appendActorsToStage ( stage , actors ) ; }
Invoked after previous view is hidden and this view is about to show . Might be called when the view is being reloaded . Clears previous stage actors and adds managed actor to stage . If overridden call super .
989
public void invalidate ( ) { if ( transitionLength <= 0f ) { currentColor . set ( targetColor ) ; redNeedsUpdate = greenNeedsUpdate = blueNeedsUpdate = alphaNeedsUpdate = false ; transitionInProgress = false ; } else { redNeedsUpdate = initialColor . r != targetColor . r ; greenNeedsUpdate = initialColor . g != targetColor . g ; blueNeedsUpdate = initialColor . b != targetColor . b ; alphaNeedsUpdate = initialColor . a != targetColor . a ; updateTransitionStatus ( ) ; if ( transitionInProgress ) { initialRedIsGreater = initialColor . r >= targetColor . r ; initialGreenIsGreater = initialColor . g >= targetColor . g ; initialBlueIsGreater = initialColor . b >= targetColor . b ; initialAlphaIsGreater = initialColor . a >= targetColor . a ; } } }
Reschedules color updates . Should be called upon manual color modifications .
990
protected void processCell ( ) { final ObjectMap < String , String > attributes = getNamedAttributes ( ) ; if ( GdxMaps . isEmpty ( attributes ) ) { processCellWithNoAttributes ( getTable ( ) ) ; return ; } final LmlActorBuilder builder = new LmlActorBuilder ( ) ; final ObjectSet < String > processedAttributes = GdxSets . newSet ( ) ; processBuildingAttributeToDetermineTable ( attributes , processedAttributes , builder ) ; final Table targetTable = getTarget ( builder ) . extract ( getTable ( ) ) ; final Cell < ? > cell = extractCell ( targetTable ) ; processCellAttributes ( attributes , processedAttributes , targetTable , cell ) ; }
This method is invoked when the tag is closed . Extracts a cell from the table .
991
protected void processBuildingAttributeToDetermineTable ( final ObjectMap < String , String > attributes , final ObjectSet < String > processedAttributes , final LmlActorBuilder builder ) { final LmlSyntax syntax = getParser ( ) . getSyntax ( ) ; for ( final Entry < String , String > attribute : attributes ) { final LmlBuildingAttribute < LmlActorBuilder > buildingAttribute = syntax . getBuildingAttributeProcessor ( builder , attribute . key ) ; if ( buildingAttribute != null ) { buildingAttribute . process ( getParser ( ) , getParent ( ) , builder , attribute . value ) ; processedAttributes . add ( attribute . key ) ; } } }
This is meant to handle toButtonTable toTitleTable toDialogTable to choose which table should have a row appended .
992
protected void processCellAttributes ( final ObjectMap < String , String > attributes , final ObjectSet < String > processedAttributes , final Table table , final Cell < ? > cell ) { final LmlSyntax syntax = getParser ( ) . getSyntax ( ) ; for ( final Entry < String , String > attribute : attributes ) { if ( processedAttributes . contains ( attribute . key ) ) { continue ; } final LmlAttribute < ? > cellAttribute = syntax . getAttributeProcessor ( table , attribute . key ) ; if ( cellAttribute instanceof AbstractCellLmlAttribute ) { ( ( AbstractCellLmlAttribute ) cellAttribute ) . process ( getParser ( ) , getParent ( ) , table , cell , attribute . value ) ; } else { if ( ! isInternalMacroAttribute ( attribute . key ) ) { getParser ( ) . throwErrorIfStrict ( getTagName ( ) + " macro can process only cell attributes. Found unknown or invalid attribute: " + attribute . key ) ; } } } }
This is meant to handle cell attributes that will modify the extracted cell .
993
public TabShowingAction show ( final Tab tabToShow , final LmlTabbedPaneListener listener ) { this . tabToShow = tabToShow ; this . listener = listener ; shown = false ; return this ; }
Chaining action for pooling utility .
994
@ SuppressWarnings ( "unchecked" ) @ OnMessage ( AutumnMessage . SKINS_LOADED ) public boolean injectFields ( final InterfaceService interfaceService ) { for ( final Entry < Pair < String , String > , Array < Pair < Field , Object > > > entry : fieldsToInject ) { final Skin skin = interfaceService . getParser ( ) . getData ( ) . getSkin ( entry . key . getSecond ( ) ) ; final String assetId = entry . key . getFirst ( ) ; if ( skin == null ) { throw new ContextInitiationException ( "Unable to inject asset: " + assetId + ". Unknown skin ID: " + entry . key . getSecond ( ) ) ; } for ( final Pair < Field , Object > injection : entry . value ) { try { Reflection . setFieldValue ( injection . getFirst ( ) , injection . getSecond ( ) , skin . get ( assetId , injection . getFirst ( ) . getType ( ) ) ) ; } catch ( final ReflectionException exception ) { throw new GdxRuntimeException ( "Unable to inject skin asset: " + assetId + " from skin: " + skin + " to field: " + injection . getFirst ( ) + " of component: " + injection . getSecond ( ) , exception ) ; } } } fieldsToInject . clear ( ) ; return OnMessage . REMOVE ; }
Invoked when all skins are loaded . Injects skin assets .
995
public void onConnect ( ) { input . setDisabled ( false ) ; sendingButton . setDisabled ( false ) ; connectingButton . setDisabled ( true ) ; disconnectingButton . setDisabled ( false ) ; }
Enables sending widgets . Disables connecting widgets .
996
public void onDisconnect ( ) { input . setDisabled ( true ) ; sendingButton . setDisabled ( true ) ; connectingButton . setDisabled ( false ) ; disconnectingButton . setDisabled ( true ) ; }
Disables sending widgets . Enables connecting widgets .
997
public boolean satisfies ( String requirement ) { Requirement req ; switch ( this . type ) { case STRICT : req = Requirement . buildStrict ( requirement ) ; break ; case LOOSE : req = Requirement . buildLoose ( requirement ) ; break ; case NPM : req = Requirement . buildNPM ( requirement ) ; break ; case COCOAPODS : req = Requirement . buildCocoapods ( requirement ) ; break ; case IVY : req = Requirement . buildIvy ( requirement ) ; break ; default : throw new SemverException ( "Invalid requirement type: " + type ) ; } return this . satisfies ( req ) ; }
Check if the version satisfies a requirement
998
public boolean isGreaterThan ( Semver version ) { if ( this . getMajor ( ) > version . getMajor ( ) ) return true ; else if ( this . getMajor ( ) < version . getMajor ( ) ) return false ; int otherMinor = version . getMinor ( ) != null ? version . getMinor ( ) : 0 ; if ( this . getMinor ( ) != null && this . getMinor ( ) > otherMinor ) return true ; else if ( this . getMinor ( ) != null && this . getMinor ( ) < otherMinor ) return false ; int otherPatch = version . getPatch ( ) != null ? version . getPatch ( ) : 0 ; if ( this . getPatch ( ) != null && this . getPatch ( ) > otherPatch ) return true ; else if ( this . getPatch ( ) != null && this . getPatch ( ) < otherPatch ) return false ; String [ ] tokens1 = this . getSuffixTokens ( ) ; String [ ] tokens2 = version . getSuffixTokens ( ) ; if ( tokens1 . length == 0 && tokens2 . length > 0 ) return true ; if ( tokens2 . length == 0 && tokens1 . length > 0 ) return false ; int i = 0 ; while ( i < tokens1 . length && i < tokens2 . length ) { int cmp ; try { int t1 = Integer . valueOf ( tokens1 [ i ] ) ; int t2 = Integer . valueOf ( tokens2 [ i ] ) ; cmp = t1 - t2 ; } catch ( NumberFormatException e ) { cmp = tokens1 [ i ] . compareToIgnoreCase ( tokens2 [ i ] ) ; } if ( cmp < 0 ) return false ; else if ( cmp > 0 ) return true ; i ++ ; } return tokens1 . length > tokens2 . length ; }
Checks if the version is greater than another version
999
public boolean isEquivalentTo ( Semver version ) { Semver sem1 = this . getBuild ( ) == null ? this : new Semver ( this . getValue ( ) . replace ( "+" + this . getBuild ( ) , "" ) ) ; Semver sem2 = version . getBuild ( ) == null ? version : new Semver ( version . getValue ( ) . replace ( "+" + version . getBuild ( ) , "" ) ) ; return sem1 . isEqualTo ( sem2 ) ; }
Checks if the version equals another version without taking the build into account .