本文整理汇总了Java中com.kotcrab.vis.ui.widget.file.FileTypeFilter类的典型用法代码示例。如果您正苦于以下问题:Java FileTypeFilter类的具体用法?Java FileTypeFilter怎么用?Java FileTypeFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileTypeFilter类属于com.kotcrab.vis.ui.widget.file包,在下文中一共展示了FileTypeFilter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: process
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final FileChooser actor,
final String rawAttributeData) {
final ActorConsumer<?, FileChooser> action = parser.parseAction(rawAttributeData, actor);
if (action == null) {
parser.throwErrorIfStrict(
"File type filter attribute expects an action that returns a FileTypeFilter instance. Action not found for: "
+ rawAttributeData);
}
final Object result = action.consume(actor);
if (result instanceof FileTypeFilter) {
actor.setFileTypeFilter((FileTypeFilter) result);
} else {
parser.throwErrorIfStrict(
"Unable to set file type filter. A method returning FileTypeFilter instance is required; got result: "
+ result);
}
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:19,代码来源:FileTypeFilterLmlAttribute.java
示例2: onEnter
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
public void onEnter() {
super.onEnter();
chooser = VisUIHelper.createOpenFileChooser(800, 450);
_visUI.getGdxUI().addUIDefault(chooser);
chooser.setListener(new StreamingFileChooserListener() {
@Override
public void selected (FileHandle file) {
switch(chooser.getMode()) {
case OPEN:
System.out.println("openFile:" + file.name());
break;
case SAVE:
System.out.println("saveFile:" + file.name());
break;
}
}
public void canceled() {
System.out.println("cancel");
}
});
final FileTypeFilter typeFilter = new FileTypeFilter(true);
typeFilter.addRule("Image files (*.png, *.jpg, *.gif)", "png", "jpg", "gif");
typeFilter.addRule("Text files (*.txt)", "txt");
typeFilter.addRule("Audio files (*.mp3, *.wav, *.ogg)", "mp3", "wav", "ogg");
chooser.setFileTypeFilter(typeFilter);
VisWindow window = VisUIHelper.createWindow("testWindow", 600, 388, true);
_visUI.getGdxUI().addUIDefault(window);
}
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:32,代码来源:VisUITests.java
示例3: initExport
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
public void initExport(MenuView menuView) {
FileTypeFilter typeFilter = new FileTypeFilter(false); //allow "All Types" mode where all files are shown
typeFilter.addRule("Audio files (*.wav)", "wav");
fileChooser.setFileTypeFilter(typeFilter);
fileChooser.setMode(FileChooser.Mode.SAVE);
fileChooser.setSize(ChiptuneTracker.getInstance().getAsciiTerminal().getFullWidth(), ChiptuneTracker.getInstance().getAsciiTerminal().getFullHeight());
fileChooser.setListener(new FileChooserAdapter() {
@Override
public void selected(Array<FileHandle> files) {
File file = files.first().file();
if (!getExtension(file.getName()).equalsIgnoreCase("wav")) {
file = new File(file.getParentFile(), getBaseName(file.getName())+".wav"); // remove the extension (if any) and replace it with ".wav"
}
if(!file.exists() || file.canWrite()) {
String fileToExport = file.getAbsolutePath();
FileRecorder fileRecorder = new FileRecorder();
try {
fileRecorder.savePattern(fileToExport);
} catch (Exception e) {
Dialogs.showErrorDialog(ChiptuneTracker.getInstance().getAsciiTerminal().getStage(), e.getMessage());
}
}
else {
Dialogs.showErrorDialog(ChiptuneTracker.getInstance().getAsciiTerminal().getStage(), "Unable to write in the file !");
}
}
@Override
public void canceled() {
}
});
ChiptuneTracker.getInstance().getAsciiTerminal().addActor(fileChooser.fadeIn());
}
开发者ID:julianmaster,项目名称:ChiptuneTracker,代码行数:40,代码来源:DataManager.java
示例4: FileTypeFilterBuilder
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
public FileTypeFilterBuilder(boolean allTypeAllowed) {
filter = new FileTypeFilter(allTypeAllowed);
}
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:4,代码来源:FileUtils.java
示例5: get
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
public FileTypeFilter get() {
return filter;
}
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:4,代码来源:FileUtils.java
示例6: setFileTypeFilter
import com.kotcrab.vis.ui.widget.file.FileTypeFilter; //导入依赖的package包/类
public void setFileTypeFilter(FileTypeFilter ftf) {
fileChooser.setFileTypeFilter(ftf);
}
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:4,代码来源:FileInputPanel.java
注:本文中的com.kotcrab.vis.ui.widget.file.FileTypeFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论