|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractTargetParameter
stella.parameter.FrameProvider
public class FrameProvider
A frame provider is a parameter that defines a certain rectangluar areas, normally depending on target picked and/or error received. This frame could be a read-out frasme on a CCD, but also a frame defining a useful area or a frame defining a moments-area.
| Nested Class Summary | |
|---|---|
static class |
FrameProvider.Test
|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private Rectangle |
defbox
This is the default frame size or null if undefined. |
static String |
DEFNAME
Default name of this parameter. |
private Map<Object,Map<Class<? extends ErrorEvent>,Rectangle>> |
errors
This lookup-table links target types to lookups of error to frames . |
static String |
KEY_DEFAULTFRAME
This is the default frame, prior to target registering. |
static String |
KEY_LISTENFOR
We ignore all errors not in this list. |
static String |
KEY_MESSAGETABLE
This keys links the combined target type plus error to frames . |
static String |
KEY_TARGETTABLE
This key links target types to frame entries. |
private Class<? extends ErrorEvent> |
lasterror
Last error event recorded after target registering. |
private Object |
lasttype
Last target type registered. |
private List<Class<? extends ErrorEvent>> |
listen
We only listen to these errors. |
private Map<Object,Rectangle> |
targets
This lookup-table links target types to frames. |
static char |
TYPEERRORSEPARATOR
This char separates the target type from the error class name in prop. |
| Fields inherited from class stella.parameter.AbstractTargetParameter |
|---|
KEY_INDEX |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| 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 stella.ErrorDependingParameter |
|---|
NAMING_EXTENSION |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
FrameProvider(Map<String,String> prop)
We start by constructing all the lookup-tables in the init section. |
|
| Method Summary | |
|---|---|
Object |
get()
After registering of targets and possible erros, we can produce a frame. |
Object |
getForError(ErrorEvent ee)
Returns the sub-frame of the currently registered target that would be active on the specified error. |
Object |
getForTarget(TargetDefinition td)
Returns the frame that would be used with the stated target, no error class can be specified. |
private Rectangle |
getFrame(Object type,
Class<? extends ErrorEvent> ee)
Returns the subframe for a given target type and a specified errror. |
void |
init()
On init, we parse the default rectangle and try to construct all the lookup tables. |
private Map<String,Rectangle> |
parseToRectangles(String s)
We parse a properties mapping to a string-to-rectangle mapping. |
void |
registerError(ErrorEvent ee)
Registers the error. |
void |
registerTarget(TargetDefinition td)
Registers the target, clears the error received. |
Object |
set(Object o)
Not allowed. |
| Methods inherited from class stella.parameter.AbstractTargetParameter |
|---|
getAsStar, getConstant, getFormattedFor, getSetup |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, rescanned, setName, toString |
| 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, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
getFormatted, getName, getString |
| 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 |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final char TYPEERRORSEPARATOR
public static final String KEY_DEFAULTFRAME
public static final String KEY_TARGETTABLE
public static final String KEY_MESSAGETABLE
public static final String KEY_LISTENFOR
public static final String DEFNAME
private Rectangle defbox
private Map<Object,Rectangle> targets
private Map<Object,Map<Class<? extends ErrorEvent>,Rectangle>> errors
private Object lasttype
private List<Class<? extends ErrorEvent>> listen
private Class<? extends ErrorEvent> lasterror
| Constructor Detail |
|---|
public FrameProvider(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class AbstractParameterpublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic void registerError(ErrorEvent ee)
registerError in interface ErrorDependingParameterpublic Object getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingParameterpublic Object getForError(ErrorEvent ee)
getForError in interface ErrorDependingParameterpublic Object get()
get in interface Parameterpublic Object set(Object o)
set in interface Parameterprivate Map<String,Rectangle> parseToRectangles(String s)
private Rectangle getFrame(Object type,
Class<? extends ErrorEvent> ee)
errors is scanned, if
that does not produce a hit, the targets table is scanned.
If again without hit, the default frame is returned, which still
might be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||