Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table
Class DefaultViewableModel

java.lang.Object
  extended by com.citra.table.DefaultViewableModel
All Implemented Interfaces:
ViewableModel

public class DefaultViewableModel
extends Object
implements ViewableModel

DefaultViewableModel is the default viewable model implementation. Its implemented method will return the default viewable object for all given cells. Programmers may retrieve this object and modify it, or assign a new viewable object. For a more complex behaviour based on the row and column attributes, you should create your own ViewableModel implementation or extend this class.

By default, the viewable object returned is one having as minimum resize width ALL_RESIZE and minimum resize height PREF_RESIZE.


Field Summary
protected  Viewable defaultView
          the default viewable object
 
Constructor Summary
DefaultViewableModel()
          Constructs a DefaultViewableModel.
 
Method Summary
 Viewable getDefaultView()
          Returns the default viewable object.
 Viewable getViewable(JTable table, int row, int column)
          Defines how the cell of table at row and column will resize its contents to its currently viewable dimensions.
 void setDefaultView(Viewable viewable)
          Assigns the default viewable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultView

protected Viewable defaultView
the default viewable object

Constructor Detail

DefaultViewableModel

public DefaultViewableModel()
Constructs a DefaultViewableModel.

Method Detail

getDefaultView

public Viewable getDefaultView()
Returns the default viewable object.

Returns:
the default viewable object

getViewable

public Viewable getViewable(JTable table,
                            int row,
                            int column)
Defines how the cell of table at row and column will resize its contents to its currently viewable dimensions. This information is contained in a Viewable object.

Specified by:
getViewable in interface ViewableModel
Parameters:
table - the table that paints the cell
row - the row index of the cell
column - the column index of the cell
Returns:
the viewable object

setDefaultView

public void setDefaultView(Viewable viewable)
Assigns the default viewable object.

Parameters:
viewable - the default viewable object to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.