Search in sources :

Example 1 with NONE

use of com.google.gwt.dom.client.Style.Display.NONE in project Zong by Xenoage.

the class WebApp method openFile.

private void openFile(String filePath) {
    // show loading, hide score
    if (loadingPanel != null)
        loadingPanel.getStyle().setDisplay(BLOCK);
    canvas.setVisible(false);
    // load score
    platformUtils().openFileAsync(filePath).thenAsync(scoreStream -> new MusicXmlScoreDocFileReader(scoreStream, null).read()).thenAsync(scoreDoc -> {
        WebApp.this.scoreDoc = scoreDoc;
        return platformUtils().openFileAsync("data/layout/default.xml");
    }).thenDo(testXmlStream -> {
        LayoutSettings layoutSettings;
        try {
            layoutSettings = LayoutSettingsReader.read(testXmlStream);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
        Size2f areaSize = new Size2f(150, 10000);
        SymbolPool symbolPool = zongPlatformUtils().getSymbolPool();
        Context context = new Context(scoreDoc.getScore(), symbolPool, layoutSettings);
        Target target = Target.completeLayoutTarget(new ScoreLayoutArea(areaSize));
        paintLayout();
        // show score, hide loading
        canvas.setVisible(true);
        if (loadingPanel != null)
            loadingPanel.getStyle().setDisplay(NONE);
    }).onError(ex -> consoleLog("Error: " + ex.toString()));
}
Also used : NONE(com.google.gwt.dom.client.Style.Display.NONE) GwtLogProcessing(com.xenoage.utils.gwt.log.GwtLogProcessing) Report.fatal(com.xenoage.utils.log.Report.fatal) EntryPoint(com.google.gwt.core.client.EntryPoint) LayoutSettings(com.xenoage.zong.musiclayout.settings.LayoutSettings) SymbolPool(com.xenoage.zong.symbols.SymbolPool) LayoutSettingsReader(com.xenoage.zong.io.musiclayout.LayoutSettingsReader) GwtErrorProcessing(com.xenoage.utils.gwt.error.GwtErrorProcessing) Size2i(com.xenoage.utils.math.geom.Size2i) Size2f(com.xenoage.utils.math.geom.Size2f) ScoreDoc(com.xenoage.zong.documents.ScoreDoc) MathUtils.clamp(com.xenoage.utils.math.MathUtils.clamp) Log(com.xenoage.utils.log.Log) Label(com.google.gwt.user.client.ui.Label) BLOCK(com.google.gwt.dom.client.Style.Display.BLOCK) PlatformUtils.platformUtils(com.xenoage.utils.PlatformUtils.platformUtils) PX(com.google.gwt.dom.client.Style.Unit.PX) Log.log(com.xenoage.utils.log.Log.log) GwtCanvasLayoutRenderer(com.xenoage.zong.renderer.gwtcanvas.GwtCanvasLayoutRenderer) Window(com.google.gwt.user.client.Window) Canvas(com.google.gwt.canvas.client.Canvas) Err(com.xenoage.utils.error.Err) Context(com.xenoage.zong.musiclayout.layouter.Context) ScoreLayoutArea(com.xenoage.zong.musiclayout.layouter.ScoreLayoutArea) ZongPlatformUtils.zongPlatformUtils(com.xenoage.zong.util.ZongPlatformUtils.zongPlatformUtils) DOM(com.google.gwt.user.client.DOM) MusicXmlScoreDocFileReader(com.xenoage.zong.io.musicxml.in.MusicXmlScoreDocFileReader) Zong(com.xenoage.zong.Zong) Target(com.xenoage.zong.musiclayout.layouter.Target) IOException(java.io.IOException) AsyncCallback(com.xenoage.utils.async.AsyncCallback) RootPanel(com.google.gwt.user.client.ui.RootPanel) Context2d(com.google.gwt.canvas.dom.client.Context2d) GwtZongPlatformUtils(com.xenoage.zong.webapp.utils.GwtZongPlatformUtils) Element(com.google.gwt.dom.client.Element) GwtPlatformUtils.consoleLog(com.xenoage.utils.gwt.GwtPlatformUtils.consoleLog) Context(com.xenoage.zong.musiclayout.layouter.Context) Target(com.xenoage.zong.musiclayout.layouter.Target) LayoutSettings(com.xenoage.zong.musiclayout.settings.LayoutSettings) Size2f(com.xenoage.utils.math.geom.Size2f) SymbolPool(com.xenoage.zong.symbols.SymbolPool) MusicXmlScoreDocFileReader(com.xenoage.zong.io.musicxml.in.MusicXmlScoreDocFileReader) IOException(java.io.IOException) ScoreLayoutArea(com.xenoage.zong.musiclayout.layouter.ScoreLayoutArea)

Aggregations

Canvas (com.google.gwt.canvas.client.Canvas)1 Context2d (com.google.gwt.canvas.dom.client.Context2d)1 EntryPoint (com.google.gwt.core.client.EntryPoint)1 Element (com.google.gwt.dom.client.Element)1 BLOCK (com.google.gwt.dom.client.Style.Display.BLOCK)1 NONE (com.google.gwt.dom.client.Style.Display.NONE)1 PX (com.google.gwt.dom.client.Style.Unit.PX)1 DOM (com.google.gwt.user.client.DOM)1 Window (com.google.gwt.user.client.Window)1 Label (com.google.gwt.user.client.ui.Label)1 RootPanel (com.google.gwt.user.client.ui.RootPanel)1 PlatformUtils.platformUtils (com.xenoage.utils.PlatformUtils.platformUtils)1 AsyncCallback (com.xenoage.utils.async.AsyncCallback)1 Err (com.xenoage.utils.error.Err)1 GwtPlatformUtils.consoleLog (com.xenoage.utils.gwt.GwtPlatformUtils.consoleLog)1 GwtErrorProcessing (com.xenoage.utils.gwt.error.GwtErrorProcessing)1 GwtLogProcessing (com.xenoage.utils.gwt.log.GwtLogProcessing)1 Log (com.xenoage.utils.log.Log)1 Log.log (com.xenoage.utils.log.Log.log)1 Report.fatal (com.xenoage.utils.log.Report.fatal)1