Class FileChooser
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Table
gaiasky.util.scene2d.OwnWindow
gaiasky.util.scene2d.CollapsibleWindow
gaiasky.gui.window.GenericDialog
gaiasky.util.scene2d.FileChooser
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout, IScreen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of files that can be chosen with this file chooserstatic classstatic interfacestatic interfaceNested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table
com.badlogic.gdx.scenes.scene2d.ui.Table.Debug, com.badlogic.gdx.scenes.scene2d.ui.Table.DebugRect -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected FileChooser.ResultListenerprotected com.badlogic.gdx.scenes.scene2d.EventListenerFields inherited from class GenericDialog
acceptButton, acceptListener, backupGamepadListeners, backupMouseKbdListeners, bottom, buttonGroup, cancelButton, cancelListener, closeListener, content, defaultGamepadListener, defaultMouseKbdListener, enterExit, escExit, gamepadListener, ignoreTouchDown, keysListener, lastPosX, lastPosY, me, modal, mouseKbdListener, scrolls, selectedTab, skin, stage, tabButtons, tabContents, tabStackModifier and TypeFieldDescriptionprotected com.badlogic.gdx.scenes.scene2d.ui.TextButtonprotected Runnableprotected Set<com.badlogic.gdx.controllers.ControllerListener> protected Set<AbstractMouseKbdListener> protected com.badlogic.gdx.scenes.scene2d.ui.Tableprotected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroupprotected com.badlogic.gdx.scenes.scene2d.ui.TextButtonprotected Runnableprotected Runnableprotected com.badlogic.gdx.scenes.scene2d.ui.Tableprotected booleanprotected booleanprotected booleanprotected booleanprotected AbstractGamepadListenerprotected com.badlogic.gdx.scenes.scene2d.InputListenerprotected booleanprotected floatprotected floatprotected GenericDialogprotected booleanprotected AbstractMouseKbdListenerprotected com.badlogic.gdx.utils.Array<OwnScrollPane> protected intCurrently selected tabprotected final com.badlogic.gdx.scenes.scene2d.ui.Skinprotected final com.badlogic.gdx.scenes.scene2d.Stageprotected com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.ui.TextButton> If this dialog has tabs, this list holds them.protected com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Group> Actual actor for each tab.protected com.badlogic.gdx.scenes.scene2d.ui.StackTab contents stack.Fields inherited from class CollapsibleWindow
collapseSpeedModifier and TypeFieldDescriptionprotected floatCollapse speed in pixels per second.Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table
backgroundBottom, backgroundLeft, backgroundRight, backgroundTop, debugActorColor, debugCellColor, debugTableColorFields inherited from class com.badlogic.gdx.scenes.scene2d.Actor
POOLS -
Constructor Summary
ConstructorsConstructorDescriptionFileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target) FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener) FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener, boolean directoryBrowsingEnabled) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept()The accept function, if any.voidbuild()Build the content here.voidcancel()The cancel function, if any.voiddispose()voidsetAcceptedFiles(String accepted) Sets the file filter.setFileNameEnabled(boolean fileNameEnabled) setFilter(DirectoryStream.Filter<Path> filter) Overrides the default filter.voidvoidsetShowHidden(boolean showHidden) voidSets a consumer that is run when the property 'showHidden' changes, whit its value.Methods inherited from class GenericDialog
acceptButton, act, addSeparator, addSeparator, addTabContent, buildSuper, cancelButton, closeAccept, closeCancel, enableComponents, focusFirstInputWidget, getBottom, getBottomGroup, getButtonsGroup, getContent, getCurrentContentContainer, getStage, getTabButtons, hasAcceptRunnable, hasCancelRunnable, hasCloseRunnable, hide, hide, recalculateButtonSize, setAcceptButtonColor, setAcceptButtonStyle, setAcceptListener, setAcceptText, setCancelButtonColors, setCancelButtonStyle, setCancelListener, setCancelText, setCloseListener, setKeyboardFocus, setModal, setUpTabListeners, show, show, show, showDialogHook, tabLeft, tabRight, touchModifier and TypeMethodDescriptioncom.badlogic.gdx.scenes.scene2d.ui.Buttonvoidact(float delta) voidAdds a horizontal separator to the main content table with the default colspan of 1.voidaddSeparator(int colSpan) Adds a horizontal separator to the main content table with the given colspan.protected voidaddTabContent(com.badlogic.gdx.scenes.scene2d.Group tabContent) Add tab contents to the list of tabs.voidcom.badlogic.gdx.scenes.scene2d.ui.ButtonbooleanCloses the window with the accept action.booleanCloses the window with the cancel action.protected voidenableComponents(boolean enabled, com.badlogic.gdx.scenes.scene2d.utils.Disableable... components) Sets the enabled property on the given components.voidcom.badlogic.gdx.scenes.scene2d.ui.Tablecom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.ui.Tablecom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.StagegetStage()com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.ui.TextButton> booleanbooleanbooleanvoidhide()Hides the dialog.voidhide(com.badlogic.gdx.scenes.scene2d.Action action) Hides the dialog with the given action and then removes it from the stage.protected voidvoidsetAcceptButtonColor(com.badlogic.gdx.graphics.Color col) voidsetAcceptButtonStyle(String style) voidSets a listener that runs when accept is clicked.voidsetAcceptText(String acceptText) voidsetCancelButtonColors(com.badlogic.gdx.graphics.Color textColor, com.badlogic.gdx.graphics.Color buttonColor) voidsetCancelButtonStyle(String style) voidSets a listener that runs when cancel is clicked.voidsetCancelText(String cancelText) voidSets a listener that runs when the dialog is closed.voidSets the keyboard focus, override in case you want to set the focus to a specific item.voidsetModal(boolean modal) protected voidPrepares the tab button listeners that make tab buttons actually change the content.show(com.badlogic.gdx.scenes.scene2d.Stage stage) Packsthe dialog and adds it to the stage, centered with default fadeIn action.show(com.badlogic.gdx.scenes.scene2d.Stage stage, float x, float y) Packsthe dialog and adds it to the stage at the specified position.show(com.badlogic.gdx.scenes.scene2d.Stage stage, com.badlogic.gdx.scenes.scene2d.Action action) Packsthe dialog and adds it to the stage with custom action which can be null for instant show.protected voidshowDialogHook(com.badlogic.gdx.scenes.scene2d.Stage stage) booleantabLeft()booleantabRight()voidtouch()Override this method to update the contents of this dialog before displaying it.Methods inherited from class CollapsibleWindow
collapse, collapseInstant, drawBackground, expand, expandInstant, getHeight, getMaxHeight, getMaxWidth, getPrefHeight, getPrefWidth, getWidth, isCollapsed, isCollapsible, pack, setCollapsible, setResizable, toggleCollapsedModifier and TypeMethodDescriptionvoidcollapse()voidprotected voiddrawBackground(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, float x, float y) voidexpand()voidfloatfloatfloatfloatfloatfloatgetWidth()booleanbooleanvoidpack()voidsetCollapsible(boolean collapsible) voidsetResizable(boolean w, boolean h) voidMethods inherited from class OwnWindow
draw, drawStageBackground, getStyle, getTitleLabel, getTitleTable, hg, hit, isModal, isResizable, keepWithinStage, setMovable, setResizable, setStyleModifier and TypeMethodDescriptionvoiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha) protected voiddrawStageBackground(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha, float x, float y, float width, float height) com.badlogic.gdx.scenes.scene2d.ui.Window.WindowStylegetStyle()Returns the window's style.com.badlogic.gdx.scenes.scene2d.ui.Labelcom.badlogic.gdx.scenes.scene2d.ui.Tableprotected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGrouphg(com.badlogic.gdx.scenes.scene2d.Actor... actors) com.badlogic.gdx.scenes.scene2d.Actorhit(float x, float y, boolean touchable) booleanisModal()booleanvoidvoidsetMovable(boolean isMovable) voidsetResizable(boolean isResizable) voidsetStyle(com.badlogic.gdx.scenes.scene2d.ui.Window.WindowStyle style) Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table
add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, clip, clip, columnDefaults, debug, debug, debugActor, debugAll, debugCell, debugTable, defaults, drawDebug, drawDebugBounds, getAlign, getBackground, getCell, getCells, getClip, getColumnMinWidth, getColumnPrefWidth, getColumns, getColumnWidth, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getRow, getRowHeight, getRowMinHeight, getRowPrefHeight, getRows, getSkin, getTableDebug, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, removeActor, removeActorAt, reset, right, row, setBackground, setBackground, setClip, setDebug, setRound, setSkin, stack, topMethods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
childrenChanged, invalidateHierarchy, needsLayout, setFillParent, setLayoutEnabled, sizeChanged, validateMethods inherited from class com.badlogic.gdx.scenes.scene2d.Group
addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, computeTransform, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toStringMethods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getTop, getTouchable, getUserObject, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront
-
Field Details
-
result
-
resultListener
-
selectionListener
protected com.badlogic.gdx.scenes.scene2d.EventListener selectionListener
-
-
Constructor Details
-
FileChooser
public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target) -
FileChooser
public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener) -
FileChooser
public FileChooser(String title, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Path baseDir, FileChooser.FileChooserTarget target, com.badlogic.gdx.scenes.scene2d.EventListener selectionListener, boolean directoryBrowsingEnabled)
-
-
Method Details
-
build
public void build()Description copied from class:GenericDialogBuild the content here.- Specified by:
buildin classGenericDialog
-
setShowHidden
public void setShowHidden(boolean showHidden) -
setShowHiddenConsumer
-
setAcceptedFiles
-
getResult
-
setFilter
Overrides the default filter. If you use this, the attributesdirectoryBrowsingEnabledandfileBrowsingEnabledwon't have effect anymore. To set additional filters on the path names, usesetFileFilter(PathnameFilter)instead.- Parameters:
filter- The new file filter- Returns:
- This file chooser
-
setFileFilter
Sets the file filter. This filter will be used to check whether file path names are accepted or not. It works in conjunction withfileBrowsingEnabled, so you do not need to check whether the pathname is a file.- Parameters:
f- The file filter.- Returns:
- This file chooser.
-
setFileNameEnabled
-
setResultListener
-
accept
public boolean accept()Description copied from class:GenericDialogThe accept function, if any.- Specified by:
acceptin classGenericDialog- Returns:
- True if the dialog must close after the call, false otherwise.
-
cancel
public void cancel()Description copied from class:GenericDialogThe cancel function, if any.- Specified by:
cancelin classGenericDialog
-
dispose
public void dispose()- Specified by:
disposein classGenericDialog
-