All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jclarion.clarion.swing.gui.GUIModel Maven / Gradle / Ivy

package org.jclarion.clarion.swing.gui;

import java.io.File;
import java.io.FileNotFoundException;

import org.jclarion.clarion.ClarionRandomAccessFile;
import org.jclarion.clarion.file.ClarionRandomAccessFileSystemFile;
import org.jclarion.clarion.runtime.CConfigImpl;
import org.jclarion.clarion.runtime.CConfigStore;


public abstract class GUIModel 
{
	private static GUIModel client=new LocalClient();
	private static GUIModel server=new LocalServer();
	private static GUIFactory factory=null;
	
	public static GUIModel getClient()
	{
		return factory!=null ? factory.getClient() : client;
	}

	public static GUIModel getServer()
	{
		return factory!=null ? factory.getServer() : server;
	}
	
	public static void setClient(GUIModel client)
	{
		GUIModel.client=client;
	}

	public static void setServer(GUIModel server)
	{
		GUIModel.server=server;
	}
	
	public static void setFactory(GUIFactory factory) {
		GUIModel.factory=factory;
	}

	public abstract void send(RemoteWidget w,int command,Object... params);
	
	public abstract void send(RemoteWidget w,ResponseRunnable nextTask,int command,Object... params);

	public abstract Object sendRecv(RemoteWidget w,int command,Object... params);
	
	public abstract void send(RemoteSemaphore rs,Object result);

	public ClarionRandomAccessFile getFile(String name) throws FileNotFoundException 
	{
		return new ClarionRandomAccessFileSystemFile(new File(FileServer.prep(name)));
	}
	
	public CConfigImpl getConfig(String name)
	{
		return CConfigStore.getInstance(name);
	}
	
	public void dispose(RemoteWidget w)
	{
	}
	
	public void dispose(RemoteSemaphore rs)
	{
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy