Search in sources :

Example 1 with ScrollFocusListener

use of com.ray3k.stripe.ScrollFocusListener in project skin-composer by raeleus.

the class Main method initDefaults.

private void initDefaults() {
    if (Utils.isMac())
        System.setProperty("java.awt.headless", "true");
    skin.getFont("font").getData().markupEnabled = true;
    // copy defaults.json to temp folder if it doesn't exist
    var fileHandle = appFolder.child("texturepacker/atlas-export-settings.json");
    if (!fileHandle.exists()) {
        Gdx.files.internal("atlas-export-settings.json").copyTo(fileHandle);
    }
    // copy atlas settings for preview to temp folder if it doesn't exist
    fileHandle = appFolder.child("texturepacker/atlas-internal-settings.json");
    if (!fileHandle.exists()) {
        Gdx.files.internal("atlas-internal-settings.json").copyTo(fileHandle);
    }
    // copy white-pixel.png for pixel drawables
    fileHandle = appFolder.child("texturepacker/white-pixel.png");
    if (!fileHandle.exists()) {
        Gdx.files.internal("white-pixel.png").copyTo(fileHandle);
    }
    // copy preview fonts to preview fonts folder if they do not exist
    fileHandle = appFolder.child("preview fonts/IBMPlexSerif-Medium.ttf");
    if (!fileHandle.exists()) {
        Gdx.files.internal("preview fonts/IBMPlexSerif-Medium.ttf").copyTo(fileHandle);
    }
    fileHandle = appFolder.child("preview fonts/Pacifico-Regular.ttf");
    if (!fileHandle.exists()) {
        Gdx.files.internal("preview fonts/Pacifico-Regular.ttf").copyTo(fileHandle);
    }
    fileHandle = appFolder.child("preview fonts/PressStart2P-Regular.ttf");
    if (!fileHandle.exists()) {
        Gdx.files.internal("preview fonts/PressStart2P-Regular.ttf").copyTo(fileHandle);
    }
    fileHandle = appFolder.child("preview fonts/SourceSansPro-Regular.ttf");
    if (!fileHandle.exists()) {
        Gdx.files.internal("preview fonts/SourceSansPro-Regular.ttf").copyTo(fileHandle);
    }
    ibeamListener = new IbeamListener();
    dialogFactory = new DialogFactory();
    projectData = new ProjectData();
    projectData.randomizeId();
    projectData.setMaxUndos(30);
    atlasData = projectData.getAtlasData();
    jsonData = projectData.getJsonData();
    newVersion = VERSION;
    if (projectData.isCheckingForUpdates()) {
        checkForUpdates(this);
    }
    undoableManager = new UndoableManager(this);
    desktopWorker.attachLogListener();
    desktopWorker.setCloseListener(() -> {
        dialogFactory.showCloseDialog(new DialogListener() {

            @Override
            public void opened() {
                desktopWorker.removeFilesDroppedListener(rootTable.getFilesDroppedListener());
            }

            @Override
            public void closed() {
                desktopWorker.addFilesDroppedListener(rootTable.getFilesDroppedListener());
            }
        });
        return false;
    });
    loadingAnimation = skin.get("loading-animation", TenPatchDrawable.class);
    loadingAnimation2 = skin.get("loading-animation2", TenPatchDrawable.class);
    projectData.getAtlasData().clearTempData();
    handListener = new HandListener();
    scrollFocusListener = new ScrollFocusListener(stage);
    verticalResizeArrowListener = new ResizeArrowListener(true);
    horizontalResizeArrowListener = new ResizeArrowListener(false);
    tooltipManager = new TooltipManager();
    tooltipManager.animations = false;
    tooltipManager.initialTime = .4f;
    tooltipManager.resetTime = 0.0f;
    tooltipManager.subsequentTime = 0.0f;
    tooltipManager.hideAll();
    tooltipManager.instant();
}
Also used : ScrollFocusListener(com.ray3k.stripe.ScrollFocusListener) DialogFactory(com.ray3k.skincomposer.dialog.DialogFactory) DialogListener(com.ray3k.skincomposer.dialog.DialogListener) ProjectData(com.ray3k.skincomposer.data.ProjectData) TenPatchDrawable(com.ray3k.tenpatch.TenPatchDrawable)

Aggregations

ProjectData (com.ray3k.skincomposer.data.ProjectData)1 DialogFactory (com.ray3k.skincomposer.dialog.DialogFactory)1 DialogListener (com.ray3k.skincomposer.dialog.DialogListener)1 ScrollFocusListener (com.ray3k.stripe.ScrollFocusListener)1 TenPatchDrawable (com.ray3k.tenpatch.TenPatchDrawable)1