1 /* 2 * (c) 2013-2015 by Mega Limited, Auckland, New Zealand 3 * 4 * This file is part of the MEGA SDK - Client Access Engine. 5 * 6 * Applications using the MEGA API must present a valid application key 7 * and comply with the the rules set forth in the Terms of Service. 8 * 9 * The MEGA SDK is distributed in the hope that it will be useful,\ 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 * @copyright Simplified (2-clause) BSD License. 13 * You should have received a copy of the license along with this 14 * program. 15 */ 16 package nz.mega.sdk; 17 18 import javax.swing.SwingUtilities; 19 20 /** 21 * Control a MEGA account or a shared folder using a Java Swing GUI. 22 * 23 * @see MegaApiJava 24 */ 25 public class MegaApiSwing extends MegaApiJava { 26 27 /** 28 * Instantiates a new MEGA API using Swing. 29 * 30 * @param appKey 31 * AppKey of your application. You can generate your AppKey for free here: <br> 32 * https://mega.co.nz/#sdk. 33 * @param userAgent 34 * User agent to use in network requests. If you pass null to this parameter, 35 * a default user agent will be used. 36 * @param path 37 * Base path to store the local cache. If you pass null to this parameter, 38 * the SDK will not use any local cache. 39 * @see MegaApiJava#MegaApiJava(String appKey, String userAgent, String basePath, MegaGfxProcessor gfxProcessor) 40 */ MegaApiSwing(String appKey, String userAgent, String path)41 public MegaApiSwing(String appKey, String userAgent, String path) { 42 super(appKey, userAgent, path, new MegaGfxProcessor()); 43 } 44 45 @Override runCallback(Runnable runnable)46 void runCallback(Runnable runnable) { 47 SwingUtilities.invokeLater(runnable); 48 } 49 } 50