|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--org.pealfactory.compose.halfleadspliced.Elf
Elf, the Online Half-lead Spliced Composing Engine.
The Elf applet provides a public API, accessible from client-side javascript,
to manage method libraries, music and composition parameters, and to
initiate and monitor searches. The search algorithm itself is handled
by the Composer class.
Note that the applet should be scripted with a 0x0 visible size, since it doesn't provide any external user interface. The UI is the sole responsibility of DHTML in the Elf website. All Elf functionality is accessed from Javascript on the invoking web page via calls to public methods in the applet. For this to function correctly a Javascript to Java communication protocol must be supported by the browser, such as LiveConnect. Browsers such as IE for the Macintosh and Netscape 6.0 do not support such communication.
Many methods in this class are public so that they can be accessed from script.
| Inner classes inherited from class java.applet.Applet |
java.applet.Applet.AccessibleApplet |
| Inner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
| Field Summary | |
boolean |
available
Used by the website to check Java VM with LiveConnect available |
private int |
fBalanceScore
|
private int |
fBestBalance
|
private int |
fBestCOM
|
private java.util.Vector |
fBestComps
|
private int |
fBestMusic
|
private int |
fBestScore
|
private Composer |
fComposer
|
private int |
fCompsPerSec
|
private int |
fCOMScore
|
private java.util.Vector |
fMethodLibrary
|
private java.util.Vector |
fMethods
|
private java.util.Vector |
fMusic
|
private int |
fNComps
|
private int |
fNCompsToKeep
|
private int |
fNodesPerSec
|
private java.lang.String |
fOutput
|
private boolean |
fOutputChanged
|
private Tables |
fTables
|
private java.lang.String |
fTimeLeft
|
private Tracker |
fTracker
|
static java.lang.String |
kHEAD_LINE
|
static int |
kMAX_NAME
|
static java.lang.String |
kNEWLINE
|
static java.lang.String |
kOPEN_SOURCE_ANNOUNCE
|
static char |
kSEPARATOR
|
| Fields inherited from class java.applet.Applet |
accessibleContext, serialVersionUID, stub |
| Fields inherited from class java.awt.Panel |
base, nameCounter |
| Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
| Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
| Fields inherited from interface org.pealfactory.compose.halfleadspliced.StandardMethods |
kASHTEAD, kBELFAST, kBRISTOL, kCAMBRIDGE, kCASSIOBURY, kGLASGOW, kLINCOLNSHIRE, kLONDON, kPUDSEY, kRUTLAND, kSUPERLATIVE, kUXBRIDGE, kYORKSHIRE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Elf()
Made public for use with Java plugin (Undomiel build). |
|
| Method Summary | |
void |
addMethod(int i)
Parameter i is index in method library |
java.lang.String |
addMethodToLibrary(java.lang.String name,
java.lang.String abbrev,
java.lang.String pn)
Returns empty string if successful, otherwise an error message. |
java.lang.String |
addMusic(java.lang.String name,
int score,
java.lang.String matches)
|
boolean |
compose(int nleads,
int nparts,
boolean tenorsTogether,
boolean nicePE,
boolean optimumBalance,
boolean maxCOM,
int calls,
boolean LHonly)
Start composition, using the passed parameter values. |
boolean |
compose(int nleads,
int nparts,
boolean tenorsTogether,
boolean nicePE,
boolean optimumBalance,
boolean maxCOM,
int calls,
boolean LHonly,
int minPartLength,
int maxPartLength)
Start composition, using the passed parameter values, including min and max part length. |
private java.lang.String |
deAccent(java.lang.String s)
Converts any HTML accent characters (e.g. |
void |
destroy()
|
java.lang.String |
getAllComps()
|
int |
getBalanceScore()
Allows method balance score to be configured from the website |
private java.lang.String |
getComp(int i)
|
int |
getCOMScore()
Allows COM score to be configured from the website |
java.lang.String |
getErrorMsg()
|
java.lang.String |
getLibraryMethod(int i)
Returns one String with name, abbreviation, PN and leadhead separated by '|' characters |
int |
getLibrarySize()
|
int |
getLongestLead()
Return the lead length of the longest method in the current composition method list. |
java.lang.String |
getMethod(int i)
|
java.lang.String |
getMusic(int i)
|
int |
getNCompsToKeep()
Allows number of comps in "top ten" list to be configured from the website |
int |
getNMethods()
|
int |
getNMusicDefs()
|
java.lang.String |
getOutput()
Now just gets the one best composition - see getAllComps(). |
int |
getShortestLead()
Return the lead length of the shortest method in the current composition method list. |
java.lang.String |
getStatus()
|
java.lang.String |
getVersionString()
Part of the public script interface. |
void |
init()
|
boolean |
isError()
Returns true if a (non-abort) error occurred. |
boolean |
isFinished()
|
boolean |
isMethodInComp(java.lang.String name)
|
boolean |
isPaused()
|
boolean |
isThereNewOutput()
|
private void |
methodsChanged()
|
private void |
musicChanged()
|
private void |
newLibraryMethod(Method newMethod)
Inserts new method into library, sorted on abbreviation. |
void |
outputComp(OutputComp latest)
Called by the Composer when a new composition meeting the score minimums is produced. |
boolean |
pause()
|
void |
removeMethod(int i)
|
void |
removeMethodFromLibrary(int i)
|
void |
removeMusic(int i)
|
void |
resetLibrary()
|
void |
resetMusic()
|
void |
resume()
|
void |
run()
Pass 1 is table build (methods - only if method table dirty). |
void |
setBalanceScore(int balanceScore)
Allows method balance score to be configured from the website |
void |
setCOMScore(int COMScore)
Allows COM score to be configured from the website |
void |
setNCompsToKeep(int NCompsToKeep)
Allows number of comps in "top ten" list to be configured from the website |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.applet.Applet |
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
| Field Detail |
public static final java.lang.String kOPEN_SOURCE_ANNOUNCE
public static final java.lang.String kHEAD_LINE
public static final int kMAX_NAME
public static final java.lang.String kNEWLINE
public static final char kSEPARATOR
public boolean available
private Composer fComposer
private Tracker fTracker
private java.util.Vector fMethodLibrary
private java.util.Vector fMethods
private java.util.Vector fMusic
private int fCOMScore
private int fBalanceScore
private Tables fTables
private java.util.Vector fBestComps
private int fNCompsToKeep
private int fNComps
private int fCompsPerSec
private int fNodesPerSec
private int fBestScore
private int fBestMusic
private int fBestCOM
private int fBestBalance
private java.lang.String fTimeLeft
private boolean fOutputChanged
private java.lang.String fOutput
| Constructor Detail |
public Elf()
| Method Detail |
public void init()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic java.lang.String getVersionString()
private java.lang.String deAccent(java.lang.String s)
ú) into
normal unaccented 7-bit ASCII (e.g. 'u').public int getNCompsToKeep()
public void setNCompsToKeep(int NCompsToKeep)
public int getCOMScore()
public void setCOMScore(int COMScore)
public int getBalanceScore()
public void setBalanceScore(int balanceScore)
public void resetMusic()
public int getNMusicDefs()
public java.lang.String getMusic(int i)
public void removeMusic(int i)
public java.lang.String addMusic(java.lang.String name,
int score,
java.lang.String matches)
private void musicChanged()
public void resetLibrary()
public int getLibrarySize()
public java.lang.String getLibraryMethod(int i)
public java.lang.String addMethodToLibrary(java.lang.String name,
java.lang.String abbrev,
java.lang.String pn)
private void newLibraryMethod(Method newMethod)
public void removeMethodFromLibrary(int i)
public int getNMethods()
public int getShortestLead()
public int getLongestLead()
public boolean isMethodInComp(java.lang.String name)
public java.lang.String getMethod(int i)
public void removeMethod(int i)
public void addMethod(int i)
i is index in method libraryprivate void methodsChanged()
public boolean compose(int nleads,
int nparts,
boolean tenorsTogether,
boolean nicePE,
boolean optimumBalance,
boolean maxCOM,
int calls,
boolean LHonly)
public boolean compose(int nleads,
int nparts,
boolean tenorsTogether,
boolean nicePE,
boolean optimumBalance,
boolean maxCOM,
int calls,
boolean LHonly,
int minPartLength,
int maxPartLength)
public java.lang.String getStatus()
public boolean isFinished()
public boolean isError()
public java.lang.String getErrorMsg()
public boolean isThereNewOutput()
public java.lang.String getOutput()
public java.lang.String getAllComps()
private java.lang.String getComp(int i)
public void run()
run in interface java.lang.Runnablepublic void outputComp(OutputComp latest)
outputComp in interface ComposerHostpublic boolean isPaused()
public boolean pause()
public void resume()
public void stop()
stop in class java.applet.Appletpublic void destroy()
destroy in class java.applet.Applet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||