stella.jview
Class JTargetTable

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jview.AbstractDisplayable
                  extended by stella.jview.JTargetTable
All Implemented Interfaces:
Cloneable, Displayable, ClusterDepending, TargetProviderDepending, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
JTargetTableRanker

public class JTargetTable
extends AbstractDisplayable
implements Displayable, ClusterDepending, TargetProviderDepending

A class that displays the list of all loaded targets in a panel. It allows sorting on supplied parameters. This is the static version, where no user input is supported. To allow the user for flexible ranking changes, use a JTargetTableRanker object instead.

This uses the more efficient JTable class for display rather then displaying a grid of JComponents.


Nested Class Summary
private  class JTargetTable.JRefreshScrollPane
          A helper class to tell the display that we need updates.
private  class JTargetTable.JSpecialTable
          For daughter classes.
private static class JTargetTable.ParameterRenderer
          A helper class that renders a value from a parameter using the parameter format rather then a default format.
static class JTargetTable.Show
          A test class to display the target list.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEFDISPLAY
          The default parameters to display.
private static int DEFMAXROWS
          The default number of targets to display in the scroll pane.
private static int DEFMAXTARGETS
          The default number of targets to consider.
private static long DEFREFRESH
          The default refresh rate.
private static boolean DEFREVERSE
          The default sorting order, not reversed.
private static String DEFSORTING
          The default parameter used for sorting.
private  Collection<ParsedTarget.Constraint> global
          Global constraints, if any.
static String KEY_DISPLAY
          The list of parameters to display beside the targets.
static String KEY_FRAME
          If another parameter is present, that grabs the panel, do nothing.
static String KEY_GLOBALCONSTRAINT
          Like in the xml-scheduler.
static String KEY_MAXROWS
          The maximum number of targets to display.
static String KEY_MAXTARGETS
          The maximum number of targets to consider.
static String KEY_REFRESH
          The key to the refresh intervall, in ms.
static String KEY_REVERSE
          The default sorting order, if true reverse sorting.
static String KEY_SORTING
          The default sorting parameter.
private  TargetProviding list
          The target source for refresh.
protected  JTable panel
          The jtable.
private  ParameterClustering set
          The entire parameter cluster grabbed via the wrapping parameter.
private  List<Parameter> show
          The list of parameters.
private  JScrollPane showpanel
          The primary component.
protected  MyTableSorter sorter
          The sorted version.
private  ParameterTableModel table
          The components in the table, row-column ordered.
 
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 util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
JTargetTable(Map<String,String> prop)
          Creates a new JTargetList parameter.
 
Method Summary
protected  boolean checkGlobalConstraints(ParameterClustering set, TargetDefinition target)
          Checks, if the target is observable under all global constraints.
 Component getRepresentation()
          Returns the prepared (#afterAll) scroll pane.
private  ParameterClustering getSet()
          Provides daughter class access to the parameter set.
protected  TableCellRenderer getSpecialRenderer(int row, int col)
          Always retruns null.
 void init()
          Initializes the show list.
 void registerCluster(ParameterClustering cluster)
          Registers the parameter cluster.
 void registerProvider(TargetProviding targetlist)
          Returns the representation of the component.
protected  void update()
          Provides daughter access to the refresh method.
 
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.Displayable
getIcon
 
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

KEY_DISPLAY

public static final String KEY_DISPLAY
The list of parameters to display beside the targets.

See Also:
Constant Field Values

KEY_SORTING

public static final String KEY_SORTING
The default sorting parameter.

See Also:
Constant Field Values

KEY_REVERSE

public static final String KEY_REVERSE
The default sorting order, if true reverse sorting.

See Also:
Constant Field Values

KEY_MAXTARGETS

public static final String KEY_MAXTARGETS
The maximum number of targets to consider.

See Also:
Constant Field Values

KEY_MAXROWS

public static final String KEY_MAXROWS
The maximum number of targets to display.

See Also:
Constant Field Values

KEY_FRAME

public static final String KEY_FRAME
If another parameter is present, that grabs the panel, do nothing.

See Also:
Constant Field Values

KEY_REFRESH

public static final String KEY_REFRESH
The key to the refresh intervall, in ms.

See Also:
Constant Field Values

KEY_GLOBALCONSTRAINT

public static final String KEY_GLOBALCONSTRAINT
Like in the xml-scheduler.

See Also:
Constant Field Values

DEFDISPLAY

private static final String DEFDISPLAY
The default parameters to display.

See Also:
Constant Field Values

DEFREVERSE

private static final boolean DEFREVERSE
The default sorting order, not reversed.

See Also:
Constant Field Values

DEFSORTING

private static final String DEFSORTING
The default parameter used for sorting.

See Also:
Constant Field Values

DEFMAXTARGETS

private static final int DEFMAXTARGETS
The default number of targets to consider.

See Also:
Constant Field Values

DEFMAXROWS

private static final int DEFMAXROWS
The default number of targets to display in the scroll pane.

See Also:
Constant Field Values

DEFREFRESH

private static final long DEFREFRESH
The default refresh rate.

See Also:
Constant Field Values

set

private ParameterClustering set
The entire parameter cluster grabbed via the wrapping parameter.


list

private TargetProviding list
The target source for refresh.


show

private List<Parameter> show
The list of parameters.


global

private Collection<ParsedTarget.Constraint> global
Global constraints, if any.


showpanel

private JScrollPane showpanel
The primary component.


table

private ParameterTableModel table
The components in the table, row-column ordered.


sorter

protected MyTableSorter sorter
The sorted version.


panel

protected JTable panel
The jtable.

Constructor Detail

JTargetTable

public JTargetTable(Map<String,String> prop)
Creates a new JTargetList parameter. The parameter is used in an independent frame, if the KEY_FRAME points to null.

Method Detail

init

public void init()
Initializes the show list.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

registerCluster

public void registerCluster(ParameterClustering cluster)
Registers the parameter cluster. Additionally we roam thru our display key to identify all parameters that should be displayed.

Specified by:
registerCluster in interface ClusterDepending

registerProvider

public void registerProvider(TargetProviding targetlist)
Returns the representation of the component. If no frame has been registered, this parameter creates its own one. Additionally, a timer task is started, again, if #frame is non-null within the JFrameParameter#addRefreshTask method, or otherwise within a fresh timer.

This method returns a JPanel with a grid-bag layout. The first row is constructed with {link #getHeaderComponent}. The component at 0,0 is empty.

Specified by:
registerProvider in interface TargetProviderDepending

getRepresentation

public Component getRepresentation()
Returns the prepared (#afterAll) scroll pane.

Specified by:
getRepresentation in interface Displayable

getSet

private ParameterClustering getSet()
Provides daughter class access to the parameter set. Can be null


update

protected void update()
Provides daughter access to the refresh method.


checkGlobalConstraints

protected boolean checkGlobalConstraints(ParameterClustering set,
                                         TargetDefinition target)
Checks, if the target is observable under all global constraints.


getSpecialRenderer

protected TableCellRenderer getSpecialRenderer(int row,
                                               int col)
Always retruns null.