|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
jview.AbstractDisplayable
jview.JAbstractAnalyser
public abstract class JAbstractAnalyser
An abstract analyser is a data change listener on a specified set name. Additionally, it is notified when the data canvas it is listening to gets visible. If it is also a viewport change listener, it receives zooming events, too.
Each analyser has a representational component, which might be
a button if analysing data takes too long to be instantly displayed and/or
more windows are to be put up. For analyser that can analyse the data on
the fly, a simple component like a Label may be sufficient. If the
#getComponet method returns null, the #getAction method
should deliver an action, which is then used for a button or menu item.
Each analyser should have a KEY_ANALYSER property set that is the
class of the analyser used. Additionally, the KEY_ANALYSESETS
property must point to the data set name this analyser is attached to.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private List<String> |
allow
The list of allowed canvi or null, if all are allowed. |
private Analyser |
anal
The analyser we pass the events to. |
private static double |
DEFEXECFACTOR
Multpliy with one. |
private static double |
DEFEXECOFFSET
No offset per default. |
private List<String> |
deny
The list of denied canvi or null, if all are allowed. |
private PropertyChangeSupport |
ear
The listners receiving analyser events. |
private static long[] |
exectime
The execution times, measured at startup. |
private VectorG[] |
input
The analyser input data constructed from the data card set. |
static String |
KEY_ALLOW
If set, only these canvi are allowed. |
static String |
KEY_ANALYSER
The key for the analyser class. |
static String |
KEY_ANALYSESETS
The key to the analysed set name. |
static String |
KEY_BASELOG
The time base in ms for log operations. |
static String |
KEY_BASEPLAIN
The time base in ms for plain operations. |
static String |
KEY_BASEPOWER
The time base in ms for power operations. |
static String |
KEY_BASERANDOM
The time base in ms for random operations. |
static String |
KEY_BASESINUS
The time base in ms for sin/cos operations. |
static String |
KEY_BASESQRT
The time base in ms for sqrt operations. |
static String |
KEY_BASETAN
The time base in ms for tan operations. |
static String |
KEY_DENY
If set, only these canvi are not allowed. |
static String |
KEY_EXECFACTOR
The time multiplier for execution time estimation. |
static String |
KEY_EXECOFFSET
The time offset in ms for execution time estimation. |
static String |
KEY_TRANSFERCLASSES
The list of class names for transferrring points to input. |
static String |
KEY_TRANSFERINIT
The list of string initializers for the transfer classes. |
static String |
KEY_VIEWPORTLISTEN
If this is true, we listen to viewport changes. |
private Collection<DataCard> |
set
The cumulated data we act on, used for add/delete. |
private Object[] |
tagging
The tagging information to the input data. |
private static String |
TIME
Tooltip text on action. |
private List<Function> |
transfer
If set, we use these functions to transfer set data to analyser input. |
| Fields inherited from class jview.AbstractDisplayable |
|---|
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface jview.DataAnalysing |
|---|
ANALYSERINPUT, ANALYSERMETA, ANALYSERPROCESS, ANALYSERVISUAL, ATTACHED |
| Fields inherited from interface util.BeanSupport |
|---|
CASTING |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
protected |
JAbstractAnalyser(Map<String,String> prop)
On construct, we pass to the super constructor, the analyser is created in the init section. |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener pcl)
Adds, if new, this property change listeners. |
void |
addPropertyChangeListener(String p,
PropertyChangeListener pcl)
Adds, if new, this property change listeners. |
private void |
canvasHidden(JDataCanvas jdc)
Called when an allowed component was hiddn, captured by a component event. |
private void |
canvasShown(JDataCanvas jdc)
Called when an allowed component was shown, captured by a component event. |
void |
componentHidden(ComponentEvent e)
Called to clear any cached data. |
void |
componentMoved(ComponentEvent e)
Empty. |
void |
componentResized(ComponentEvent e)
Empty. |
void |
componentShown(ComponentEvent e)
The component that is shown is analysed if analysing of the underlying data canvas is allowed. |
void |
dataChanged(DataChangeEvent dce)
Called when the observed data changed. |
protected long |
estimateExecutionTime(VectorG[] in)
Estimates the execution time based on the input data. |
long |
estimateExecutionTime(VectorG[] in,
Analyser anal)
Estimates the execution time based on the input data. |
protected void |
firePropertyChange(String propname,
Object old,
Object now)
Notifies all registered property change listeners. |
List<String> |
getAnalysedSets()
Gets the set name we register to. |
Analyser |
getAnalyser()
Returns my analyser. |
VectorG[] |
getAnalyserInput()
As a source for the analysers, we use the original data, as it comes with error bars. |
Object[] |
getDataTagging()
Whoever wants to track the taggings that came along with the original data. |
void |
init()
We scan the properties for the KEY_ANALYSER property and try
to create that from my properties. |
void |
propertyChange(PropertyChangeEvent e)
If the visible area changes, we grep all data in the component, as well as when we lost some data. |
void |
removePropertyChangeListener(PropertyChangeListener pcl)
Removes this property change listeners. |
void |
removePropertyChangeListener(String p,
PropertyChangeListener pcl)
Removes this property change listeners. |
protected void |
setAnalyserInput(VectorG[] in)
This is the method that is called whenever the analyser input data is modified. |
protected void |
setDataTagging(Object[] keys)
This method is called when the data tagging is set. |
private JDataCanvas |
traceSource(ComponentEvent e)
Tries to get the data canvas from the component event. |
private void |
transferAnalyserInput(Map<String,Object> ai)
We set the analyser input and fire a property change. |
private Map<String,Object> |
vectorData(Collection<DataCard> dc)
Analyser work on an array of VectorGs, but the data is normally provided as data cards. |
| Methods inherited from class jview.AbstractDisplayable |
|---|
getComponentName, getIcon, getIcon |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jview.DataAnalysing |
|---|
getAnalyserAction |
| Methods inherited from interface jview.Displayable |
|---|
getIcon, getRepresentation |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_ANALYSER
public static final String KEY_VIEWPORTLISTEN
public static final String KEY_ANALYSESETS
public static final String KEY_ALLOW
public static final String KEY_DENY
public static final String KEY_BASEPLAIN
public static final String KEY_BASESINUS
public static final String KEY_BASETAN
public static final String KEY_BASESQRT
public static final String KEY_BASELOG
public static final String KEY_BASEPOWER
public static final String KEY_BASERANDOM
public static final String KEY_EXECOFFSET
public static final String KEY_EXECFACTOR
public static final String KEY_TRANSFERCLASSES
public static final String KEY_TRANSFERINIT
private static final String TIME
private static final double DEFEXECOFFSET
private static final double DEFEXECFACTOR
private Collection<DataCard> set
private List<Function> transfer
private VectorG[] input
private Object[] tagging
private PropertyChangeSupport ear
private Analyser anal
private List<String> allow
private List<String> deny
private static final long[] exectime
| Constructor Detail |
|---|
protected JAbstractAnalyser(Map<String,String> prop)
| Method Detail |
|---|
public void init()
KEY_ANALYSER property and try
to create that from my properties.
init in interface Initializableinit in class PropertyResourcespublic void addPropertyChangeListener(PropertyChangeListener pcl)
addPropertyChangeListener in interface BeanSupport
public void addPropertyChangeListener(String p,
PropertyChangeListener pcl)
addPropertyChangeListener in interface BeanSupportpublic void removePropertyChangeListener(PropertyChangeListener pcl)
removePropertyChangeListener in interface BeanSupport
public void removePropertyChangeListener(String p,
PropertyChangeListener pcl)
removePropertyChangeListener in interface BeanSupportpublic VectorG[] getAnalyserInput()
getAnalyserInput in interface DataAnalysingpublic Object[] getDataTagging()
getDataTagging in interface DataAnalysingpublic List<String> getAnalysedSets()
getAnalysedSets in interface DataAnalysingpublic Analyser getAnalyser()
getAnalyser in interface DataAnalysingpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentShown(ComponentEvent e)
KEY_ALLOW nor KEY_DENY
are set, it is allowed.KEY_ALLOW is set and contains the component's name,
it is allowed.KEY_DENY is set and the name of the component
matches an entry, it is denied, otherwise it is allowed.canvasShown(jview.JDataCanvas) method.
componentShown in interface ComponentListenerpublic void dataChanged(DataChangeEvent dce)
dataChanged in interface DataObserverprivate JDataCanvas traceSource(ComponentEvent e)
protected long estimateExecutionTime(VectorG[] in)
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListener
public long estimateExecutionTime(VectorG[] in,
Analyser anal)
estimateExecutionTime in interface DataAnalysingprivate Map<String,Object> vectorData(Collection<DataCard> dc)
KEY_TRANSFERCLASSES and KEY_TRANSFERINIT
keys. Any transfer not defined, e.g. if the data point has more
components then there are entries in the transfer function list, means
that the identical transfer is used fot that component.
If further transformations than simple
copying is required, subclasses may override this method. The output
of this method is cached, propagated as a property change event, and
retrievable with getAnalyserInput().
protected void firePropertyChange(String propname,
Object old,
Object now)
private void canvasShown(JDataCanvas jdc)
private void transferAnalyserInput(Map<String,Object> ai)
protected void setAnalyserInput(VectorG[] in)
protected void setDataTagging(Object[] keys)
setAnalyserInput(vec_math.VectorG[])private void canvasHidden(JDataCanvas jdc)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||