| Package | org.aswing |
| Class | public class JTable |
| Inheritance | JTable Container Component AWSprite flash.display.Sprite |
| Implements | CellEditorListener, LayoutManager, TableColumnModelListener, TableModelListener, Viewportable |
JTable is used to display and edit regular two-dimensional tables
of cells.
The JTable has many
facilities that make it possible to customize its rendering and editing
but provides defaults for these features so that simple tables can be
set up easily. For example, to set up a table with 10 rows and 10
columns of numbers:
class MyTableModel extends AbstractTableModel{
public function getColumnCount():int { return 10; }
public function getRowCount():int { return 10;}
public getValueAt(row:int, col:int) { return rowol; }
};
var dataModel:MyTableModel = new MyTableModel();
var table:JTable = new JTable(dataModel);
var scrollpane:JScrollPane = new JScrollPane(table);
Note that if you wish to use a JTable in a standalone
view (outside of a JScrollPane) and want the header
displayed, you can get it using {
| Property | Defined by | ||
|---|---|---|---|
![]() | bounds : IntRectangle | Component | |
| cellPane : Container | JTable | ||
![]() | children : Array | Container | |
![]() | d_numChildren : int | AWSprite | |
![]() | drawTransparentTrigger : Boolean = true | Component | |
![]() | d_visible : Boolean
Returns the
DisplayObject.visible directly. | Component | |
![]() | d_x : Number
Returns
DisplayObject.x directly. | Component | |
![]() | d_y : Number
Returns
DisplayObject.y directly. | Component | |
| headerPane : Container | JTable | ||
![]() | layout : LayoutManager | Container | |
![]() | readyToPaint : Boolean | Component | |
![]() | ui : ComponentUI | Component | |
![]() | valid : Boolean | Component | |
| Method | Defined by | ||
|---|---|---|---|
|
JTable(dm:TableModel = null)
Constructs a default
JTable. | JTable | ||
|
__listSelectionChanged(e:SelectionEvent):void
Invoked when the row selection changes -- repaints to show the new
selection.
| JTable | ||
![]() |
addChild(dis:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
| AWSprite | |
![]() |
addChildAt(child:DisplayObject, index:int):DisplayObject
| AWSprite | |
|
addColumn(aColumn:TableColumn):void
Appends
aColumn to the end of the array of columns held by
this JTable's column model. | JTable | ||
|
addColumnSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void
Adds the columns from
index0 to index1,
inclusive, to the current selection. | JTable | ||
|
addColumnSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to column selection changed.
| JTable | ||
![]() |
addDragAcceptableInitiator(com:Component):void
Adds a component to be the acceptable drag initiator to this component.
| Component | |
|
addLayoutComponent(comp:Component, constraints:Object):void
do nothing
| JTable | ||
|
addRowSelectionInterval(index0:int, index1:int, programmatic:Boolean = true):void
Adds the rows from
index0 to index1, inclusive, to
the current selection. | JTable | ||
|
addSelectionListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Adds a listener to row selection changed.
| JTable | ||
|
addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a listener to listen the viewpoat state change event.
| JTable | ||
![]() |
On Component just can add to one Container.
| Container | |
![]() |
appendAll(... coms):void
Adds one or more component to the container with null constraints
| Container | |
![]() |
bringToBottom(child:DisplayObject):void
Brings a child to bottom.
| AWSprite | |
![]() |
bringToTop(child:DisplayObject):void
Brings a child to top.
| AWSprite | |
|
changeSelection(rowIndex:int, columnIndex:int, toggle:Boolean, extend:Boolean, programmatic:Boolean = true):void
Updates the selection models of the table, depending on the state of the
two flags:
toggle and extend. | JTable | ||
|
clearSelection(programmatic:Boolean = true):void
Deselects all selected columns and rows.
| JTable | ||
|
columnAdded(e:TableColumnModelEvent):void
Invoked when a column is added to the table column model.
| JTable | ||
|
columnAtPoint(point:IntPoint):int
Returns the index of the column that
point lies in,
or -1 if the result is not in the range
[0, getColumnCount()-1]. | JTable | ||
|
columnMarginChanged(source:TableColumnModel):void
Invoked when a column is moved due to a margin change.
| JTable | ||
|
columnMoved(e:TableColumnModelEvent):void
Invoked when a column is repositioned.
| JTable | ||
|
columnRemoved(e:TableColumnModelEvent):void
Invoked when a column is removed from the table column model.
| JTable | ||
|
columnSelectionChanged(source:TableColumnModel, firstIndex:int, lastIndex:int, programmatic:Boolean):void
Invoked when the selection model of the
TableColumnModel
is changed. | JTable | ||
![]() | Component | ||
![]() |
containsChild(child:DisplayObject):Boolean
Returns whether child is directly child of this sprite, true only if getChildIndex(child) >= 0.
| AWSprite | |
|
convertColumnIndexToModel(viewColumnIndex:int):int
Maps the index of the column in the view at
viewColumnIndex to the index of the column
in the table model. | JTable | ||
|
convertColumnIndexToView(modelColumnIndex:int):int
Maps the index of the column in the table model at
modelColumnIndex to the index of the column
in the view. | JTable | ||
|
createDefaultCellFactories():void
| JTable | ||
| JTable | |||
|
Creates default columns for the table from
the data model using the
getColumnCount method
defined in the TableModel interface. | JTable | ||
| JTable | |||
|
createDefaultEditors():void
| JTable | ||
| JTable | |||
| JTable | |||
|
doLayout():void
Causes this table to lay out its rows and columns.
| JTable | ||
|
editCellAt(row:int, column:int, clickCount:int = -1):Boolean
editCellAt(row:int, column:int, clickCount:int):Boolean
editCellAt(row:int, column:int):Boolean
Programmatically starts editing the cell at | JTable | ||
|
editingCanceled(source:CellEditor):void
Invoked when editing is canceled.
| JTable | ||
|
editingStopped(source:CellEditor):void
Invoked when editing is finished.
| JTable | ||
|
ensureCellIsVisible(row:int, column:int):void
Scrolls the JTable to make the specified cell completely visible.
| JTable | ||
![]() |
fireFocusKeyDownEvent(e:KeyboardEvent):void
| Component | |
![]() |
fireFocusKeyUpEvent(e:KeyboardEvent):void
| Component | |
![]() |
getAlignmentX():Number
Returns the alignment along the x axis.
| Component | |
![]() |
getAlignmentY():Number
Returns the alignment along the y axis.
| Component | |
![]() |
getAlpha():Number
Returns the alpha of this component.
| Component | |
|
getAutoCreateColumnsFromModel():Boolean
Determines whether the table will create default columns from the model.
| JTable | ||
|
getAutoResizeMode():int
Returns the auto resize mode of the table.
| JTable | ||
![]() |
getAwmlID():String
Returns ID used to identify components created from AWML.
| Component | |
![]() |
getAwmlIndex():Number
Returns position index of the component inside its AWML container.
| Component | |
![]() |
getAwmlNamespace():String
Returns namespace name used to identify components created from AWML.
| Component | |
![]() |
Gets the background color of this component.
| Component | |
![]() |
Returns the background decorator of this component.
| Component | |
![]() |
Returns the border.
| Component | |
![]() |
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Same to DisplayObject.getBounds(),
just add a explaination here that if you want to get the component bounds,
see {
| Component | |
| JTable | |||
|
getCellEditorOfRowColumn(row:int, column:int):TableCellEditor
| JTable | ||
|
getCellFactory(row:int, column:int):TableCellFactory
| JTable | ||
|
Returns the container that holds the cells.
| JTable | ||
|
getCellRect(row:int, column:int, includeSpacing:Boolean):IntRectangle
Returns a rectangle for the cell that lies at the intersection of
row and column. | JTable | ||
|
getCellSelectionEnabled():Boolean
Returns true if both row and column selection models are enabled.
| JTable | ||
![]() |
getChildAt(index:int):DisplayObject
| AWSprite | |
![]() |
getChildByName(name:String):DisplayObject
| AWSprite | |
![]() |
getChildIndex(child:DisplayObject):int
| AWSprite | |
![]() |
getClientProperty(key:*):*
Returns the value of the property with the specified key.
| Component | |
![]() |
Returns the clip bounds.
| Component | |
|
getColumn(identifier:Object):TableColumn
Returns the
TableColumn object for the column in the table
whose identifier is equal to identifier, when compared using
equals. | JTable | ||
|
getColumnAt(columnIndex:int):TableColumn
Returns the
TableColumn object for the column at
columnIndex. | JTable | ||
|
getColumnClass(column:int):String
Returns the type of the column appearing in the view at
column position
column. | JTable | ||
|
getColumnCount():int
Returns the number of columns in the column model.
| JTable | ||
|
Returns the
TableColumnModel that contains all column information
of this table. | JTable | ||
|
getColumnName(column:int):String
Returns the name of the column appearing in the view at
column position
column. | JTable | ||
|
getColumnSelectionAllowed():Boolean
Returns true if columns can be selected.
| JTable | ||
![]() |
Stores the bounds value of this component into "return value" rv and returns rv. | Component | |
![]() |
getComponent(index:int):Component
Gets the nth(index) component in this container.
| Container | |
![]() |
getComponentCount():int
Gets the number of components in this container.
| Container | |
![]() |
getConstraints():Object
Gets cpmponent's constraints.
| Component | |
|
getDefaultBasicUIClass():Class
| JTable | ||
|
getDefaultCellFactory(columnClass:String):TableCellFactory
Returns the cell factory to be used when no factory has been set in
a
TableColumn. | JTable | ||
|
getDefaultEditor(columnClass:String):TableCellEditor
Returns the editor to be used when no editor has been set in
a
TableColumn. | JTable | ||
|
getEditingColumn():int
Returns the index of the column that contains the cell currently
being edited.
| JTable | ||
|
getEditingRow():int
Returns the index of the row that contains the cell currently
being edited.
| JTable | ||
| JTable | |||
![]() |
Returns the focus manager for this component's stage,
or null if this component is not on stage.
| Component | |
![]() |
Returns the focus traversal policy of this container, it will return its parent's
focus traversal policy if its self is null.
| Container | |
![]() |
Gets the font of this component.
| Component | |
![]() |
Gets the foreground color of this component.
| Component | |
![]() |
Returns the foreground decorator of this component.
| Component | |
![]() |
Stores the global location value of this component into "return value" p and returns p.
| Component | |
|
Returns the color used to draw grid lines.
| JTable | ||
|
getHeaderHeight():int
Returns the header height.
| JTable | ||
![]() |
getHeight():int
Returns the current height of this component
| Component | |
![]() |
Returns the current top index for a new child(none forground child).
| AWSprite | |
| JTable | |||
| JTable | |||
![]() |
Returns the index of the child component in this container.
| Container | |
![]() |
If a border has been set on this component, returns the border's insets;
otherwise returns an empty insets.
| Component | |
|
Returns the horizontal and vertical space between cells.
| JTable | ||
![]() |
getInternalFocusObject():InteractiveObject
Returns the object to receive the focus for this component.
| Component | |
![]() |
Returns the keyboard manager of this component's
JRootPane ancestor. | Component | |
![]() | Container | ||
|
getLayoutAlignmentX(target:Container):Number
return 0
| JTable | ||
|
getLayoutAlignmentY(target:Container):Number
return 0
| JTable | ||
![]() |
Stores the location value of this component into "return value" rv and returns rv.
| Component | |
|
Returns the location in the JTable view area of the logic location.
| JTable | ||
![]() |
Returns the current bottom index for none background child.
| AWSprite | |
![]() |
getMaximumHeight():int
Returns
getMaximumSize().height
| Component | |
![]() |
| Component | |
![]() |
getMaximumWidth():int
Returns
getMaximumSize().width
| Component | |
![]() |
getMinimumHeight():int
Returns
getMinimumSize().height
| Component | |
![]() |
| Component | |
![]() |
getMinimumWidth():int
Returns
getMinimumSize().width
| Component | |
|
Returns the
TableModel that provides the data displayed by this
JTable. | JTable | ||
![]() |
Returns the coordinate of the mouse position, in pixels, in the component scope.
| Component | |
![]() |
getName():String
Returns the name of the component
| Component | |
![]() |
Returns the bounds that component should paint in.
| Component | |
![]() |
Returns the
Container parent,
if it parent is not a Container, null will be returned. | Component | |
|
Returns the location in the JTable view area of the logic location.
| JTable | ||
![]() |
getPreferredHeight():int
Returns
getPreferredSize().height
| Component | |
|
Returns the preferred size of the viewport for this table.
| JTable | ||
![]() |
| Component | |
![]() |
getPreferredWidth():int
Returns
getPreferredSize().width
| Component | |
![]() |
Returns the first
JRootPane ancestor of this component. | Component | |
|
getRowCount():int
Returns the number of rows in this table's model.
| JTable | ||
|
getRowHeight():int
Returns the height of a table row, in pixels.
| JTable | ||
|
getRowMargin():int
Gets the amount of empty space, in pixels, between cells.
| JTable | ||
|
getRowSelectionAllowed():Boolean
Returns true if rows can be selected.
| JTable | ||
|
getSelectedColumn():int
Returns the index of the first selected column,
-1 if no column is selected.
| JTable | ||
|
getSelectedColumnCount():int
Returns the number of selected columns.
| JTable | ||
|
getSelectedColumns():Array
Returns the indices of all selected columns.
| JTable | ||
|
getSelectedRow():int
Returns the index of the first selected row, -1 if no row is selected.
| JTable | ||
|
getSelectedRowCount():int
Returns the number of selected rows.
| JTable | ||
|
getSelectedRows():Array
Returns the indices of all selected rows.
| JTable | ||
|
Returns the background color for selected cells.
| JTable | ||
|
Returns the foreground color for selected cells.
| JTable | ||
|
Returns the
ListSelectionModel that is used to maintain row
selection state. | JTable | ||
|
getShowHorizontalLines():Boolean
Returns true if the table draws horizontal lines between cells, false if it
doesn't.
| JTable | ||
|
getShowVerticalLines():Boolean
Returns true if the table draws vertical lines between cells, false if it
doesn't.
| JTable | ||
![]() |
Stores the size value of this component into "return value" rv and returns rv.
| Component | |
|
Returns the
tableHeader used by this JTable. | JTable | ||
| JTable | |||
![]() |
getToolTipText():String
Returns the tooltip string that has been set with setToolTipText.
| Component | |
![]() | Component | ||
|
getUIClassID():String
Returns the suffix used to construct the name of the L&F class used to
render this component.
| JTable | ||
|
getValueAt(row:int, column:int):Object
Returns the cell value at
row and column. | JTable | ||
| JTable | |||
|
getVerticalUnitIncrement():int
| JTable | ||
| JTable | |||
| JTable | |||
| JTable | |||
![]() |
getWidth():int
Returns the current width of this component
| Component | |
![]() |
getX():int
Returns the current x coordinate of the components.
| Component | |
![]() |
getY():int
Returns the current y coordinate of the components.
| Component | |
![]() | Component | ||
![]() |
hitTestMouse():Boolean
Returns whether the component hit the mouse.
| Component | |
![]() |
hitTestObject(obj:DisplayObject):Boolean
| AWSprite | |
![]() |
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
| AWSprite | |
![]() |
Add component to spesified index.
| Container | |
![]() |
insertAll(index:int, ... coms):void
Insets one or more component to the container with null constraints at specified starting index.
| Container | |
![]() |
invalidate():void
Invalidates the container.
| Container | |
|
invalidateLayout(target:Container):void
| JTable | ||
![]() |
invalidatePreferSizeCaches():void
Clears this component and all parents above it's preferred size caches.
| Component | |
![]() |
isAncestorOf(c:Component):Boolean
Checks if the component is contained in the component hierarchy of
this container.
| Container | |
![]() |
isCachePreferSizes():Boolean
Returns whether or not the preferred size, minimum size and
max size cache is turned on.
| Component | |
|
isCellEditable(row:int, column:int):Boolean
Returns true if the cell at
row and column
is editable. | JTable | ||
|
isCellSelected(row:int, column:int):Boolean
Returns true if the specified indices are in the valid range of rows
and columns and the cell at the specified position is selected.
| JTable | ||
![]() |
isClipMasked():Boolean
Returns whether the component clip should be masked by its bounds.
| AWSprite | |
|
isColumnSelected(column:int):Boolean
Returns true if the specified index is in the valid range of columns,
and the column at that index is selected.
| JTable | ||
![]() |
isDragAcceptableInitiator(com:Component):Boolean
Returns whether the component is acceptable drag initiator for this component.
| Component | |
![]() |
isDragEnabled():Boolean
Returns whether this component can fire ON_DRAG_RECOGNIZED event.
| Component | |
![]() |
isDropTrigger():Boolean
Returns whether this component can trigger dragging component to fire drag events
when dragging over to this component.(Default value is false)
| Component | |
|
isEditing():Boolean
Returns true if a cell is being edited.
| JTable | ||
![]() |
isEnabled():Boolean
Returns whether the component is enabled.
| Component | |
![]() |
isFocusable():Boolean
Returns whether this Component can be focused.
| Component | |
![]() |
isFocusableSet():Boolean
Returns whether or not the opaque property is set by user.
| Component | |
![]() |
isFocusOwner():Boolean
Returns
true if this Component is the
focus owner. | Component | |
![]() |
isFontValidated():Boolean
Returns whether the new font are applied and taked effect.
| Component | |
![]() |
isOnStage():Boolean
Determines whether or not this component is on stage(on the display list).
| Component | |
![]() |
isOpaque():Boolean
Returns true if this component is completely opaque.
| Component | |
![]() |
isOpaqueSet():Boolean
Returns whether or not the opaque property is set by user.
| Component | |
|
isRowSelected(row:int):Boolean
Returns true if the specified index is in the valid range of rows,
and the row at that index is selected.
| JTable | ||
![]() |
isShowing():Boolean
Determines whether this component is showing on screen.
| Component | |
![]() |
isUIElement():Boolean
Returns true if this component is just a ui element component,
false means this component is a regular use created component.
| Component | |
![]() |
isValid():Boolean
Determines whether this component is valid.
| Component | |
![]() |
isValidateRoot():Boolean
If this method returns true, revalidate calls by descendants of this
component will cause the entire tree beginning with this root to be validated.
| Component | |
![]() |
isVisible():Boolean
| Component | |
|
layoutContainer(target:Container):void
position and fill cells here
| JTable | ||
![]() |
makeFocus():void
Makes this component's internal focus object to be the stage focus directly,
without any judgement.
| Component | |
| JTable | |||
| JTable | |||
|
moveColumn(column:int, targetColumn:int):void
Moves the column
column to the position currently
occupied by the column targetColumn in the view. | JTable | ||
![]() |
pack():void
Causes this component to be sized to fit the preferred size.
| Component | |
![]() |
paintFocusRect(force:Boolean = false):void
Paints the focus rect if need.
| Component | |
![]() |
paintImmediately():void
Redraw the component UI face immediately if it is visible and ready to paint.
| Component | |
![]() |
parentReAppendChildren():void
Calls parent reAppendChildren if parent is a container.
| Component | |
| JTable | |||
![]() |
putClientProperty(key:*, value:*):void
Adds an arbitrary key/value "client property" to this component.
| Component | |
![]() |
reAppendChildren():void
Removes all children and then append them with their constraints.
| Container | |
![]() |
reAppendToParent(constraints:Object = null):void
Removes this component from its parent and then append it with specified constraints.
| Component | |
![]() |
Remove the specified child component.
| Container | |
![]() |
removeAll():void
Remove all child components.
| Container | |
![]() |
Remove the specified index child component.
| Container | |
![]() |
removeChild(child:DisplayObject):DisplayObject
Removes a normal display object child.
| Container | |
![]() |
removeChildAt(index:int):DisplayObject
Removes a normal display object child with index.
| Container | |
| &nb | |||