public class FrameProvider extends AbstractTargetParameter implements ErrorDependingParameter
| Modifier and Type | Class and Description |
|---|---|
static class |
FrameProvider.Test |
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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.
|
KEY_INDEXKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
FrameProvider(Map<String,String> prop)
We start by constructing all the lookup-tables in the init section.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFormatted, getName, getStringdefaultBoolean, 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, stringPropertiespublic 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,Map<Class<? extends ErrorEvent>,Rectangle>> errors
private Object lasttype
private List<Class<? extends ErrorEvent>> listen
private Class<? extends ErrorEvent> lasterror
public void init()
throws InitException
init in interface Initializableinit in class AbstractParameterInitExceptionpublic 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()
private Map<String,Rectangle> parseToRectangles(String s)
private Rectangle getFrame(Object type, Class<? extends ErrorEvent> ee)