fr.emn.inputeditor
Class Proxy

java.lang.Object
  extended byfr.emn.inputeditor.Proxy

public class Proxy
extends java.lang.Object

Used to communicate between graphical objects and devices


Field Summary
static int COMPATIBLE_ALWAYS
           
static int COMPATIBLE_FOR_NOW
           
static int INCOMPATIBLE_ALWAYS
           
static int INCOMPATIBLE_FOR_NOW
           
 
Constructor Summary
Proxy()
           
 
Method Summary
static void addListener(ProxyListener l)
          Listener management
protected static void assign(Lite lite, java.lang.Object obj)
          Devices are automatically assigned in createNode()
static void configurationStarted(Configuration c)
           
static void configurationStopped(Configuration c)
           
protected static LiteDesk createDesk(Configuration source)
          Not fully implemented
protected static LiteDesk createDeskTMP(DeviceFolder source)
           
static JFolders createJFolders(Configuration source)
           
protected static LiteNode createNode(Configuration c, GenericProperties p, Device d)
          Creates a lite node with its properties, usually for deserialization.
protected static LiteNode createNode(Configuration c, java.lang.String label, Device device)
          Creates a LiteNode and fill its slots, according to the given device.
static LiteNode createNodeCopy(LiteNode source)
          Creates a copy of a LiteNode, assigned with a new copied device.
static LiteNode createNodeShortcut(LiteNode source)
          Creates a copy of a LiteNode, assigned with the same device.
static void deviceFailed(Configuration c, Device d)
           
static void deviceOpened(Configuration c, Device d)
           
static void doAddNode(LiteDesk c, LiteNode node)
           
static void doChangeLabel(LiteDesk d, LiteNode n, java.lang.String lbl)
           
static boolean doChangeNodeParameter(LiteDesk desk, LiteNode node, java.lang.String name, java.lang.Object value)
           
static void doCreateLink(LiteDesk c, LiteInSlot in, LiteOutSlot out)
           
static LiteNode[][] doPrepareRunning(LiteDesk c)
           
static boolean doPrepareRunning(LiteDesk c, LiteNode n)
           
static void doRelease(LiteDesk c)
          Call this when you do not want to run this configuration for a long time, or before closing the configuration.
static void doRemoveLink(LiteDesk c, LiteInSlot in, LiteOutSlot out)
           
static void doRemoveNode(LiteDesk c, LiteNode node)
           
static void doStartRunning(LiteDesk c, boolean withAnalysis)
          Starts the configuration.
static void doStopRunning(LiteDesk c)
          Stops running without deallocating resources (devices stay open).
protected static void fireDeskStarted(LiteDesk d)
           
protected static void fireDeskStopped(LiteDesk d)
           
protected static void fireNodesFailed(LiteDesk d, LiteNode[] n)
           
protected static void fireNodesOpened(LiteDesk d, LiteNode[] n)
           
protected static Configuration getConfiguration(LiteDesk desk)
           
static java.lang.String getDescription(LiteDesk desk, LiteNode node)
           
static java.lang.String getDescription(LiteDesk desk, LiteSlot slot)
           
protected static java.util.Vector getDesks(Configuration c)
           
protected static Device getDevice(LiteNode node)
           
static java.lang.String getEditorScript(LiteDesk desk)
          Creates the "Editor" section of the configuration script.
static java.util.Vector getEquivalentNodes(LiteNode node)
          Returns all the nodes with the same device.
protected static java.lang.String getError(LiteNode node)
           
protected static DeviceFolder getFolder(javax.swing.tree.TreeNode node)
           
protected static DeviceFolder getFolderTMP(LiteSortedDesk desk)
          NOT USED
static int getFrequency(LiteDesk d)
           
static java.lang.String getHelp(LiteDesk desk, Lite lite)
           
static java.lang.String getHelp(LiteDesk desk, LiteNode node)
           
static java.lang.String getHelp(LiteDesk desk, LiteSlot slot)
           
static javax.swing.JFrame getJFrameContext(LiteDesk d)
           
static int getLinkCompatibility(LiteSlot source, LiteSlot dest)
           
protected static LiteSlot getLiteSlot(LiteNode n, Slot s)
           
protected static java.util.Vector getLiteSlots(Slot s)
          Returns a Vector of LiteNode objects
static java.lang.String getNodeAlias(LiteDesk desk, LiteNode node)
           
static java.util.Vector getNodeParameters(LiteNode node)
          Returns the names and types of the device parameters in the form: [String] [Class] [String] [Class] ...
static java.lang.Object getNodeParameterValue(LiteNode node, java.lang.String name)
           
protected static java.util.Vector getNodes(Device d)
          Returns a Vector of LiteNode objects
static GenericProperties getProperties(Lite lite)
          Returns lite properties used for serialization
static java.lang.String getScript(LiteDesk desk)
          Returns the full script (Configuration + Editor layout) of this LiteDesk.
protected static Slot getSlot(LiteSlot slot)
           
static boolean isEmpty(LiteDesk desk)
           
static boolean isLinkGeneratingCycle(LiteDesk desk, LiteSlot source, LiteSlot dest)
          PENDING: A refaire avec 4 slots en parametres.
static boolean isLinkValid(LiteDesk conf, LiteSlot source, LiteSlot dest)
          This is used for interactive wiring, so that valid destination slots are highlighted.
static boolean isLinkValid(LiteDesk conf, LiteSlot s1, LiteSlot s2, LiteSlot disconnect1, LiteSlot disconnect2)
          This is used for interactive wiring, so that valid destination slots are highlighted.
static boolean isNodeActive(LiteNode node)
          Returns true if the device is openable.
static boolean isNodeMutable(LiteNode node)
          Returns true if the device is mutable.
static boolean isRunning(LiteDesk desk)
           
static boolean isSmallSize(javax.swing.tree.TreeNode n, LiteNode ln)
           
static boolean loadDesk(LiteDesk desk, java.io.File icFile)
           
static void mutate(LiteDesk d, LiteNode n)
          Force a single device to mutate without propagating mutations (used for debugging).
static void removeListener(ProxyListener l)
           
static boolean saveDesk(LiteDesk desk, java.io.File icFile)
           
static void setFrequency(LiteDesk d, int freq)
           
protected static void unassign(Lite lite)
           
protected static void unassignChildren(LiteContainer lite)
          Unassign all children form this lite.
static LiteNode[] updateDesk(LiteDesk c)
          Updates this desk with current config and returns nodes that need to be redisplayed.
static void updateDesk(LiteDesk desk, java.lang.String script)
          Updates this desk with a new config script (the Configuration object is kept).
static void updateJNodesView(JNodesView nodesview, javax.swing.tree.TreeNode folder)
           
protected static void updateNode(LiteNode node)
          Updates a LiteNode object.
protected static void updateNodes(java.util.Vector nodes)
          Update LiteNodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCOMPATIBLE_ALWAYS

public static final int INCOMPATIBLE_ALWAYS
See Also:
Constant Field Values

INCOMPATIBLE_FOR_NOW

public static final int INCOMPATIBLE_FOR_NOW
See Also:
Constant Field Values

COMPATIBLE_FOR_NOW

public static final int COMPATIBLE_FOR_NOW
See Also:
Constant Field Values

COMPATIBLE_ALWAYS

public static final int COMPATIBLE_ALWAYS
See Also:
Constant Field Values
Constructor Detail

Proxy

public Proxy()
Method Detail

assign

protected static void assign(Lite lite,
                             java.lang.Object obj)
Devices are automatically assigned in createNode()


createDesk

protected static LiteDesk createDesk(Configuration source)
Not fully implemented


createDeskTMP

protected static LiteDesk createDeskTMP(DeviceFolder source)

createJFolders

public static JFolders createJFolders(Configuration source)

createNode

protected static LiteNode createNode(Configuration c,
                                     GenericProperties p,
                                     Device d)
Creates a lite node with its properties, usually for deserialization.


getNodeAlias

public static java.lang.String getNodeAlias(LiteDesk desk,
                                            LiteNode node)

createNode

protected static LiteNode createNode(Configuration c,
                                     java.lang.String label,
                                     Device device)
Creates a LiteNode and fill its slots, according to the given device.


createNodeCopy

public static LiteNode createNodeCopy(LiteNode source)
Creates a copy of a LiteNode, assigned with a new copied device.


createNodeShortcut

public static LiteNode createNodeShortcut(LiteNode source)
Creates a copy of a LiteNode, assigned with the same device.


doAddNode

public static void doAddNode(LiteDesk c,
                             LiteNode node)

doChangeNodeParameter

public static boolean doChangeNodeParameter(LiteDesk desk,
                                            LiteNode node,
                                            java.lang.String name,
                                            java.lang.Object value)

doCreateLink

public static void doCreateLink(LiteDesk c,
                                LiteInSlot in,
                                LiteOutSlot out)

mutate

public static void mutate(LiteDesk d,
                          LiteNode n)
Force a single device to mutate without propagating mutations (used for debugging).


doPrepareRunning

public static LiteNode[][] doPrepareRunning(LiteDesk c)

doPrepareRunning

public static boolean doPrepareRunning(LiteDesk c,
                                       LiteNode n)

doRelease

public static void doRelease(LiteDesk c)
Call this when you do not want to run this configuration for a long time, or before closing the configuration.

You may run this configuration again, but preparation may take more time.


doRemoveLink

public static void doRemoveLink(LiteDesk c,
                                LiteInSlot in,
                                LiteOutSlot out)

doRemoveNode

public static void doRemoveNode(LiteDesk c,
                                LiteNode node)

doStartRunning

public static void doStartRunning(LiteDesk c,
                                  boolean withAnalysis)
Starts the configuration. Before calling this method, you may call prepareRunning to check errors.


doStopRunning

public static void doStopRunning(LiteDesk c)
Stops running without deallocating resources (devices stay open). Called before editing a configuration.


getConfiguration

protected static Configuration getConfiguration(LiteDesk desk)

getDescription

public static java.lang.String getDescription(LiteDesk desk,
                                              LiteNode node)

getDescription

public static java.lang.String getDescription(LiteDesk desk,
                                              LiteSlot slot)

getDevice

protected static Device getDevice(LiteNode node)

getEditorScript

public static java.lang.String getEditorScript(LiteDesk desk)
Creates the "Editor" section of the configuration script.


getEquivalentNodes

public static java.util.Vector getEquivalentNodes(LiteNode node)
Returns all the nodes with the same device.


getError

protected static java.lang.String getError(LiteNode node)

getFolder

protected static DeviceFolder getFolder(javax.swing.tree.TreeNode node)

getFolderTMP

protected static DeviceFolder getFolderTMP(LiteSortedDesk desk)
NOT USED


getHelp

public static java.lang.String getHelp(LiteDesk desk,
                                       LiteNode node)

getHelp

public static java.lang.String getHelp(LiteDesk desk,
                                       LiteSlot slot)

getHelp

public static java.lang.String getHelp(LiteDesk desk,
                                       Lite lite)

getLinkCompatibility

public static int getLinkCompatibility(LiteSlot source,
                                       LiteSlot dest)

getLiteSlot

protected static LiteSlot getLiteSlot(LiteNode n,
                                      Slot s)

getLiteSlots

protected static java.util.Vector getLiteSlots(Slot s)
Returns a Vector of LiteNode objects


getNodeParameters

public static java.util.Vector getNodeParameters(LiteNode node)
Returns the names and types of the device parameters in the form: [String] [Class] [String] [Class] ...


getNodeParameterValue

public static java.lang.Object getNodeParameterValue(LiteNode node,
                                                     java.lang.String name)

getNodes

protected static java.util.Vector getNodes(Device d)
Returns a Vector of LiteNode objects


getDesks

protected static java.util.Vector getDesks(Configuration c)

getProperties

public static GenericProperties getProperties(Lite lite)
Returns lite properties used for serialization


getScript

public static java.lang.String getScript(LiteDesk desk)
Returns the full script (Configuration + Editor layout) of this LiteDesk.


getSlot

protected static Slot getSlot(LiteSlot slot)

isEmpty

public static boolean isEmpty(LiteDesk desk)

isLinkGeneratingCycle

public static boolean isLinkGeneratingCycle(LiteDesk desk,
                                            LiteSlot source,
                                            LiteSlot dest)
PENDING: A refaire avec 4 slots en parametres.


isLinkValid

public static boolean isLinkValid(LiteDesk conf,
                                  LiteSlot source,
                                  LiteSlot dest)
This is used for interactive wiring, so that valid destination slots are highlighted. This method integrates the grammar of visual interaction. It does NOT test cycles (instead, call isLinkGeneratingCycle())


isLinkValid

public static boolean isLinkValid(LiteDesk conf,
                                  LiteSlot s1,
                                  LiteSlot s2,
                                  LiteSlot disconnect1,
                                  LiteSlot disconnect2)
This is used for interactive wiring, so that valid destination slots are highlighted. This method integrates the grammar of visual interaction. It does NOT test cycles (instead, call isLinkGeneratingCycle())


isNodeActive

public static boolean isNodeActive(LiteNode node)
Returns true if the device is openable.


isNodeMutable

public static boolean isNodeMutable(LiteNode node)
Returns true if the device is mutable.


isRunning

public static boolean isRunning(LiteDesk desk)

unassign

protected static void unassign(Lite lite)

unassignChildren

protected static void unassignChildren(LiteContainer lite)
Unassign all children form this lite.


updateDesk

public static LiteNode[] updateDesk(LiteDesk c)
Updates this desk with current config and returns nodes that need to be redisplayed.


loadDesk

public static boolean loadDesk(LiteDesk desk,
                               java.io.File icFile)

saveDesk

public static boolean saveDesk(LiteDesk desk,
                               java.io.File icFile)

updateDesk

public static void updateDesk(LiteDesk desk,
                              java.lang.String script)
Updates this desk with a new config script (the Configuration object is kept).


updateJNodesView

public static void updateJNodesView(JNodesView nodesview,
                                    javax.swing.tree.TreeNode folder)

updateNode

protected static void updateNode(LiteNode node)
Updates a LiteNode object.


updateNodes

protected static void updateNodes(java.util.Vector nodes)
Update LiteNodes.


getFrequency

public static int getFrequency(LiteDesk d)

setFrequency

public static void setFrequency(LiteDesk d,
                                int freq)

doChangeLabel

public static void doChangeLabel(LiteDesk d,
                                 LiteNode n,
                                 java.lang.String lbl)

isSmallSize

public static boolean isSmallSize(javax.swing.tree.TreeNode n,
                                  LiteNode ln)

getJFrameContext

public static javax.swing.JFrame getJFrameContext(LiteDesk d)

addListener

public static void addListener(ProxyListener l)
Listener management


removeListener

public static void removeListener(ProxyListener l)

fireNodesOpened

protected static void fireNodesOpened(LiteDesk d,
                                      LiteNode[] n)

fireNodesFailed

protected static void fireNodesFailed(LiteDesk d,
                                      LiteNode[] n)

fireDeskStarted

protected static void fireDeskStarted(LiteDesk d)

fireDeskStopped

protected static void fireDeskStopped(LiteDesk d)

deviceOpened

public static void deviceOpened(Configuration c,
                                Device d)

deviceFailed

public static void deviceFailed(Configuration c,
                                Device d)

configurationStarted

public static void configurationStarted(Configuration c)

configurationStopped

public static void configurationStopped(Configuration c)