idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
124,600
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 .
124,601
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 . get...
Utility method that processes all named attributes of the selected type .
124,602
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 value...
MUST be called before using range s numeric values .
124,603
public void addViewActionContainer ( final String actionContainerId , final ActionContainer actionContainer ) { parser . getData ( ) . addActionContainer ( actionContainerId , actionContainer ) ; }
Registers an action container globally for all views .
124,604
public void addViewAction ( final String actionId , final ActorConsumer < ? , ? > action ) { parser . getData ( ) . addActorConsumer ( actionId , action ) ; }
Registers an action globally for all views .
124,605
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 . ...
Allows to manually register a managed controller . For internal use mostly .
124,606
public void showDialog ( final Class < ? > dialogControllerClass ) { if ( currentController != null ) { dialogControllers . get ( dialogControllerClass ) . show ( currentController . getStage ( ) ) ; } }
Allows to show a globally registered dialog .
124,607
public void initiateAllControllers ( ) { for ( final ViewController controller : controllers . values ( ) ) { initiateView ( controller ) ; } for ( final ViewDialogController controller : dialogControllers . values ( ) ) { if ( controller instanceof AnnotatedViewDialogController ) { final AnnotatedViewDialogController ...
Forces eager initiation of all views managed by registered controllers . Initiates dialogs that cache and reuse their dialog actor instance .
124,608
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 .
124,609
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 .
124,610
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 .
124,611
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 .
124,612
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 .
124,613
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 .
124,614
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 .
124,615
public void saveMusicPreferences ( final boolean flush ) { if ( Strings . isNotEmpty ( musicPreferences ) ) { if ( Strings . isNotEmpty ( musicVolumePreferenceName ) ) { saveInPreferences ( musicPreferences , musicVolumePreferenceName , musicVolume ) ; } if ( Strings . isNotEmpty ( musicEnabledPreferenceName ) ) { save...
Saves music volume and state in preferences .
124,616
public void saveSoundPreferences ( final boolean flush ) { if ( Strings . isNotEmpty ( musicPreferences ) ) { if ( Strings . isNotEmpty ( soundVolumePreferenceName ) ) { saveInPreferences ( musicPreferences , soundVolumePreferenceName , soundVolume ) ; } if ( Strings . isNotEmpty ( soundEnabledPreferenceName ) ) { save...
Saves sound volume and state in preferences .
124,617
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 : pa...
LibGDX code goes here . Slightly modified refactored and without unnecessary operations .
124,618
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 . getArgume...
Does the actual parsing
124,619
private void processArgument ( ) { final StringBuilder argumentBuilder = new StringBuilder ( ) ; while ( templateReader . hasNextCharacter ( ) ) { final char argumentCharacter = templateReader . nextCharacter ( ) ; if ( argumentCharacter == syntax . getArgumentClosing ( ) ) { final String argument = argumentBuilder . t...
Found an argument opening sign . Have to find argument s name and replace it in the template .
124,620
private void processComment ( ) { templateReader . nextCharacter ( ) ; if ( templateReader . startsWith ( syntax . getDocumentTypeOpening ( ) ) ) { processSchemaComment ( ) ; return ; } else if ( nestedComments ) { processNestedComment ( ) ; return ; } while ( templateReader . hasNextCharacter ( ) ) { final char commen...
Found an open tag starting with comment sign . Burning through characters up to the comment s end .
124,621
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 ( ch...
Found a comment starting with DOCTYPE . Burning through the characters .
124,622
private void processNestedComment ( ) { int nestedCommentsAmount = 1 ; while ( templateReader . hasNextCharacter ( ) ) { final char commentCharacter = templateReader . nextCharacter ( ) ; if ( isCommentClosingMarker ( commentCharacter ) && templateReader . hasNextCharacter ( ) && templateReader . peekCharacter ( ) == s...
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 .
124,623
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 . g...
Found an open tag that is not a comment . Collecting whole tag data .
124,624
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: " + rawA...
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 .
124,625
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 ( ! ke...
Invoked after template parsing . Hooks up the listener to actors registered by attachTo attribute .
124,626
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 .
124,627
public void resize ( final int width , final int height , final boolean centerCamera ) { stage . getViewport ( ) . update ( width , height , centerCamera ) ; }
Updates stage s viewport .
124,628
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 .
124,629
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...
Parses names proceeding styles block .
124,630
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 { tag...
Appends tag or inheritance name from the current builder data .
124,631
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: '" + ...
Parses attributes block .
124,632
protected void addAttributeName ( ) { if ( Strings . isNotEmpty ( builder ) ) { attribute = builder . toString ( ) ; Strings . clearBuilder ( builder ) ; } }
Caches currently parsed attribute name .
124,633
protected void addAttribute ( ) { attributes . put ( attribute , builder . toString ( ) . trim ( ) ) ; attribute = null ; Strings . clearBuilder ( builder ) ; }
Clears attribute cache adds default attribute value .
124,634
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 .
124,635
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 .
124,636
public void reset ( ) { attribute = null ; tags . clear ( ) ; inherits . clear ( ) ; attributes . clear ( ) ; Strings . clearBuilder ( builder ) ; }
Clears control variables .
124,637
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 .
124,638
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 .
124,639
public static void setKeyboardFocus ( final Actor actor ) { if ( actor != null && actor . getStage ( ) != null ) { actor . getStage ( ) . setKeyboardFocus ( actor ) ; } }
Null - safe method for setting keyboard focus .
124,640
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 .
124,641
@ 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 .
124,642
protected void fadeOutCurrentTheme ( ) { if ( currentTheme != null && currentTheme . isPlaying ( ) ) { currentTheme . setOnCompletionListener ( null ) ; stage . addAction ( Actions . sequence ( VolumeAction . setVolume ( currentTheme , currentTheme . getVolume ( ) , 0f , duration , Interpolation . fade ) , MusicStopAct...
Smoothly fades out current theme .
124,643
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 ....
Smoothly fades in current theme .
124,644
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 .
124,645
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 .
124,646
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 ) ,...
Invokes the stored method with the chosen arguments .
124,647
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 .
124,648
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 ( wid...
Forces update of current world size according to window size . Will try to keep the set aspect ratio .
124,649
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 ) ; localePreferenc...
Also available as setLocale action in LML views . Will extract locale from actor s ID .
124,650
protected void addDefaultComponents ( ) { final boolean mapSuper = context . isMapSuperTypes ( ) ; context . setMapSuperTypes ( false ) ; final AssetManagerProvider assetManagerProvider = new AssetManagerProvider ( ) ; context . addProvider ( assetManagerProvider ) ; context . addDestructible ( assetManagerProvider ) ;...
Registers multiple providers and singletons that produce LibGDX - related object instances .
124,651
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 .
124,652
private void destroyInitializer ( ) { GdxMaps . clearAll ( fieldProcessors , methodProcessors , typeProcessors ) ; GdxArrays . clearAll ( scannedMetaAnnotations , scannedAnnotations , processors , delayedConstructions , manuallyAddedComponents , manuallyAddedProcessors ) ; }
Clears meta - data collections .
124,653
@ 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 |...
Processes components class annotations .
124,654
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 . getDeclaredMe...
Scans class tree of component to process all its methods .
124,655
@ 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 = ge...
Does the actual processing of found methods .
124,656
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 . getDeclaredField...
Scans class tree of component to process all its fields .
124,657
@ 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 = getAnnot...
Does the actual processing of found fields .
124,658
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 .
124,659
protected void registerActorTags ( ) { addTagProvider ( new ActorLmlTagProvider ( ) , "actor" , "group" ) ; addTagProvider ( new ActorStorageLmlTagProvider ( ) , "actorStorage" , "isolate" ) ; addTagProvider ( new AnimatedImageLmlTagProvider ( ) , "animatedImage" ) ; addTagProvider ( new ButtonGroupLmlTagProvider ( ) ,...
Registers actor - based tags that create widgets .
124,660
protected void registerMacroTags ( ) { addMacroTagProvider ( new ActorLmlMacroTagProvider ( ) , "actor" ) ; addMacroTagProvider ( new AnyNotNullLmlMacroTagProvider ( ) , "anyNotNull" , "any" ) ; addMacroTagProvider ( new ArgumentLmlMacroTagProvider ( ) , "nls" , "argument" , "preference" ) ; addMacroTagProvider ( new A...
Registers macro tags that manipulate templates structures .
124,661
protected void registerBuildingAttributes ( ) { addBuildingAttributeProcessor ( new SkinLmlAttribute ( ) , "skin" ) ; addBuildingAttributeProcessor ( new StyleLmlAttribute ( ) , "style" , "class" ) ; addBuildingAttributeProcessor ( new OnResultInitialLmlAttribute ( ) , "result" , "onResult" ) ; addBuildingAttributeProc...
Attributes used during widget creation .
124,662
protected void registerCommonAttributes ( ) { addAttributeProcessor ( new ActionLmlAttribute ( ) , "action" , "onShow" ) ; addAttributeProcessor ( new ColorAlphaLmlAttribute ( ) , "alpha" , "a" ) ; addAttributeProcessor ( new ColorBlueLmlAttribute ( ) , "blue" , "b" ) ; addAttributeProcessor ( new ColorGreenLmlAttribut...
Attributes applied to all actors .
124,663
protected void registerListenerAttributes ( ) { addAttributeProcessor ( new ConditionLmlAttribute ( ) , "if" ) ; addAttributeProcessor ( new KeepListenerLmlAttribute ( ) , "keep" ) ; addAttributeProcessor ( new ListenerIdsLmlAttribute ( ) , "ids" ) ; addAttributeProcessor ( new CombinedKeysLmlAttribute ( ) , "combined"...
Listener tags attributes .
124,664
protected void registerAnimatedImageAttributes ( ) { addAttributeProcessor ( new AnimationDelayLmlAttribute ( ) , "delay" ) ; addAttributeProcessor ( new AnimationMaxDelayLmlAttribute ( ) , "maxDelay" ) ; addAttributeProcessor ( new BackwardsLmlAttribute ( ) , "backwards" ) ; addAttributeProcessor ( new BouncingLmlAttr...
AnimatedImage widget attributes .
124,665
protected void registerContainerAttributes ( ) { addAttributeProcessor ( new ContainerAdjustPaddingLmlAttribute ( ) , "adjustPadding" ) ; addAttributeProcessor ( new ContainerAlignLmlAttribute ( ) , "align" ) ; addAttributeProcessor ( new ContainerBackgroundLmlAttribute ( ) , "bg" , "background" ) ; addAttributeProcess...
Container widget attributes .
124,666
protected void registerHorizontalGroupAttributes ( ) { addAttributeProcessor ( new HorizontalGroupAlignmentLmlAttribute ( ) , "groupAlign" ) ; addAttributeProcessor ( new HorizontalGroupFillLmlAttribute ( ) , "groupFill" ) ; addAttributeProcessor ( new HorizontalGroupPaddingBottomLmlAttribute ( ) , "groupPadBottom" ) ;...
HorizontalGroup widget attributes .
124,667
protected void registerLabelAttributes ( ) { addAttributeProcessor ( new EllipsisLmlAttribute ( ) , "ellipsis" ) ; addAttributeProcessor ( new LabelAlignmentLmlAttribute ( ) , "labelAlign" , "labelAlignment" ) ; addAttributeProcessor ( new LineAlignmentLmlAttribute ( ) , "lineAlign" , "lineAlignment" ) ; addAttributePr...
Label widget attributes .
124,668
protected void registerListAttributes ( ) { addAttributeProcessor ( new MultipleLmlAttribute ( ) , "multiple" ) ; addAttributeProcessor ( new RangeSelectLmlAttribute ( ) , "rangeSelect" ) ; addAttributeProcessor ( new RequiredLmlAttribute ( ) , "required" ) ; addAttributeProcessor ( new SelectedLmlAttribute ( ) , "sele...
List widget attributes .
124,669
protected void registerScrollBarAttributes ( ) { addAttributeProcessor ( new ScrollBarsOnTopLmlAttribute ( ) , "barsOnTop" , "scrollbarsOnTop" ) ; addAttributeProcessor ( new ScrollBarsPositionsLmlAttribute ( ) , "barsPositions" , "scrollBarsPositions" ) ; addAttributeProcessor ( new ScrollCancelTouchFocusLmlAttribute ...
ScrollBar widget attributes .
124,670
protected void registerTableAttributes ( ) { addAttributeProcessor ( new OneColumnLmlAttribute ( ) , "oneColumn" ) ; addAttributeProcessor ( new TableAlignLmlAttribute ( ) , "tableAlign" ) ; addAttributeProcessor ( new TableBackgroundLmlAttribute ( ) , "bg" , "background" ) ; addAttributeProcessor ( new TablePadBottomL...
Table widget attributes .
124,671
protected void registerCellAttributes ( ) { addCellAttributeProcessor ( new CellAlignLmlAttribute ( ) , "align" ) ; addCellAttributeProcessor ( new CellColspanLmlAttribute ( ) , "colspan" ) ; addCellAttributeProcessor ( new CellExpandLmlAttribute ( ) , "expand" ) ; addCellAttributeProcessor ( new CellExpandXLmlAttribut...
Attributes available to children tags of a Table parent .
124,672
protected void registerTextFieldAttributes ( ) { addAttributeProcessor ( new BlinkTimeLmlAttribute ( ) , "blink" , "blinkTime" ) ; addAttributeProcessor ( new CursorLmlAttribute ( ) , "cursor" , "cursorPosition" ) ; addAttributeProcessor ( new DigitsOnlyLmlAttribute ( ) , "digitsOnly" , "numeric" ) ; addAttributeProces...
TextField widget attributes .
124,673
protected void registerVerticalGroupAttributes ( ) { addAttributeProcessor ( new VerticalGroupAlignmentLmlAttribute ( ) , "groupAlign" ) ; addAttributeProcessor ( new VerticalGroupFillLmlAttribute ( ) , "groupFill" ) ; addAttributeProcessor ( new VerticalGroupPaddingBottomLmlAttribute ( ) , "groupPadBottom" ) ; addAttr...
VerticalGroup widget attributes .
124,674
protected void registerWindowAttributes ( ) { addAttributeProcessor ( new KeepWithinStageLmlAttribute ( ) , "keepWithinStage" , "keepWithin" ) ; addAttributeProcessor ( new ModalLmlAttribute ( ) , "modal" ) ; addAttributeProcessor ( new MovableLmlAttribute ( ) , "movable" ) ; addAttributeProcessor ( new ResizeableLmlAt...
Window widget attributes .
124,675
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 .
124,676
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 ( annotationTyp...
Utility method that allows to extract actual annotation from class bypassing LibGDX annotation wrapper . Returns null if annotation is not present .
124,677
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 .
124,678
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 .
124,679
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 != targetC...
Reschedules color updates . Should be called upon manual color modifications .
124,680
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 = GdxSet...
This method is invoked when the tag is closed . Extracts a cell from the table .
124,681
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 Lm...
This is meant to handle toButtonTable toTitleTable toDialogTable to choose which table should have a row appended .
124,682
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 ( processedA...
This is meant to handle cell attributes that will modify the extracted cell .
124,683
public TabShowingAction show ( final Tab tabToShow , final LmlTabbedPaneListener listener ) { this . tabToShow = tabToShow ; this . listener = listener ; shown = false ; return this ; }
Chaining action for pooling utility .
124,684
@ 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 ( ) . get...
Invoked when all skins are loaded . Injects skin assets .
124,685
public void onConnect ( ) { input . setDisabled ( false ) ; sendingButton . setDisabled ( false ) ; connectingButton . setDisabled ( true ) ; disconnectingButton . setDisabled ( false ) ; }
Enables sending widgets . Disables connecting widgets .
124,686
public void onDisconnect ( ) { input . setDisabled ( true ) ; sendingButton . setDisabled ( true ) ; connectingButton . setDisabled ( false ) ; disconnectingButton . setDisabled ( true ) ; }
Disables sending widgets . Enables connecting widgets .
124,687
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 : re...
Check if the version satisfies a requirement
124,688
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 (...
Checks if the version is greater than another version
124,689
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 ( ) , ...
Checks if the version equals another version without taking the build into account .
124,690
public VersionDiff diff ( Semver version ) { if ( ! Objects . equals ( this . major , version . getMajor ( ) ) ) return VersionDiff . MAJOR ; if ( ! Objects . equals ( this . minor , version . getMinor ( ) ) ) return VersionDiff . MINOR ; if ( ! Objects . equals ( this . patch , version . getPatch ( ) ) ) return Versio...
Returns the greatest difference between 2 versions . For example if the current version is 1 . 2 . 3 and compared version is 1 . 3 . 0 the biggest difference is the MINOR number .
124,691
public static Requirement buildNPM ( String requirement ) { if ( requirement . isEmpty ( ) ) { requirement = "*" ; } return buildWithTokenizer ( requirement , Semver . SemverType . NPM ) ; }
Builds a requirement following the rules of NPM .
124,692
private static List < Token > addParentheses ( List < Token > tokens ) { List < Token > result = new ArrayList < Token > ( ) ; result . add ( new Token ( TokenType . OPENING , "(" ) ) ; for ( Token token : tokens ) { if ( token . type == TokenType . OR ) { result . add ( new Token ( TokenType . CLOSING , ")" ) ) ; resu...
Return parenthesized expression giving lowest priority to OR operator
124,693
private static List < Tokenizer . Token > toReversePolishNotation ( List < Tokenizer . Token > tokens ) { LinkedList < Tokenizer . Token > queue = new LinkedList < Tokenizer . Token > ( ) ; Stack < Tokenizer . Token > stack = new Stack < Tokenizer . Token > ( ) ; for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { Token...
Adaptation of the shutting yard algorithm
124,694
private static Requirement evaluateReversePolishNotation ( Iterator < Tokenizer . Token > iterator , Semver . SemverType type ) { try { Tokenizer . Token token = iterator . next ( ) ; if ( token . type == Tokenizer . TokenType . VERSION ) { if ( "*" . equals ( token . value ) || ( type == Semver . SemverType . NPM && "...
Evaluates a reverse polish notation token list
124,695
protected static Requirement hyphenRequirement ( String lowerVersion , String upperVersion , Semver . SemverType type ) { if ( type != Semver . SemverType . NPM ) { throw new SemverException ( "The hyphen requirements are only compatible with NPM." ) ; } Semver lower = extrapolateVersion ( new Semver ( lowerVersion , t...
Creates a requirement that satisfies x1 . y1 . z1 - x2 . y2 . z2 .
124,696
private static Semver extrapolateVersion ( Semver semver ) { StringBuilder sb = new StringBuilder ( ) . append ( semver . getMajor ( ) ) . append ( "." ) . append ( semver . getMinor ( ) == null ? 0 : semver . getMinor ( ) ) . append ( "." ) . append ( semver . getPatch ( ) == null ? 0 : semver . getPatch ( ) ) ; boole...
Extrapolates the optional minor and patch numbers . - 1 = 1 . 0 . 0 - 1 . 2 = 1 . 2 . 0 - 1 . 2 . 3 = 1 . 2 . 3
124,697
public boolean isSatisfiedBy ( Semver version ) { if ( this . range != null ) { return this . range . isSatisfiedBy ( version ) ; } else { switch ( this . op ) { case AND : try { List < Range > set = getAllRanges ( this , new ArrayList < Range > ( ) ) ; for ( Range range : set ) { if ( ! range . isSatisfiedBy ( version...
Checks if the requirement is satisfied by a version .
124,698
public JSONObject toJSON ( ) throws JSONException { JSONObject json = new JSONObject ( ) ; json . put ( JSON_TYPE , this . getType ( ) ) ; return json ; }
Formats the object s attributes as GeoJSON .
124,699
public void setFeatures ( List < Feature > features ) { this . mFeatures . clear ( ) ; if ( features != null ) { this . mFeatures . addAll ( features ) ; } }
Sets the list of features contained within this feature collection . All previously existing features are removed as a result of setting this property .