|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
com.citra.table.AdvancedJScrollPane
public class AdvancedJScrollPane
This subclass of JScrollPane ensures that the scrollpane will adjust correctly to the last (dummy) column added by AdvancedJTable.
Nested Class Summary | |
---|---|
class |
AdvancedJScrollPane.LockedTextField
LockedTextField is a textfield suitable when locked rows/columns are in place. |
Nested classes/interfaces inherited from class javax.swing.JScrollPane |
---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
containsViewable
flag that is true if the scrollpane is configured to use a viewable resizer, false otherwise |
protected LockedTableModel |
lockedTableModel
the locked table column model |
Fields inherited from class javax.swing.JScrollPane |
---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AdvancedJScrollPane()
Creates an empty (no viewport view) AdvancedJScrollPane where both horizontal and vertical scrollbars appear when needed. |
|
AdvancedJScrollPane(Component view)
Creates an AdvancedJScrollPane that displays the contents of the specified component, where both horizontal and vertical scrollbars appear whenever the component's contents are larger than the view. |
|
AdvancedJScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Creates an AdvancedJScrollPane that displays the view component in a viewport whose view position can be controlled with a pair of scrollbars. |
|
AdvancedJScrollPane(int vsbPolicy,
int hsbPolicy)
Creates an empty (no viewport view) AdvancedJScrollPane with specified scrollbar policies. |
Method Summary | |
---|---|
int |
convertBackX(int x)
Coverts an x-coordinate back from the ordinate system that is modified by locked rows/columns. |
int |
convertBackY(int y)
Coverts an y-coordinate back from the ordinate system that is modified by locked rows/columns. |
int |
convertX(int x)
Coverts an x-coordinate to the ordinate system that is modified by locked rows/columns. |
int |
convertX(int x,
int delta)
Coverts an x-coordinate to the ordinate system that is modified by locked rows/columns. |
int |
convertY(int y)
Coverts a y-coordinate to the ordinate system that is modified by locked rows/columns. |
protected LockedTableModel |
createDefaultLockedModel()
Creates and returns the default locked table model. |
JScrollBar |
createHorizontalScrollBar()
Returns a specialized horizontal scrollbar which is a subclass of JScrollPane.ScrollBar. |
void |
doLayout()
Causes this container to lay out its components. |
boolean |
getContainsViewable()
Determines whether the scrollpane is configured to use a viewable resizer . |
LockedTableModel |
getLockedModel()
Returns the locked table model. |
void |
layout()
Causes this container to lay out its components. |
Component |
prepareEditorComponent(TableCellEditor editor,
Component c,
int row,
int column)
Prepares and returns a table cell editor component suitable for locked rows/columns. |
void |
setColumnHeader(JViewport viewport)
Removes the old columnHeader, if it exists. |
void |
setColumnHeaderView(Component view)
Creates a column-header viewport if necessary, sets its view, and then adds the column-header viewport to the scrollpane. |
void |
setContainsViewable(boolean containsViewable)
Enables/disables the viewable resizer functionality in the scrollpane. |
void |
setLockedModel(LockedTableModel lockedTableModel)
Assigns a new locked table model. |
void |
setRowHeader(JViewport viewport)
Removes the old rowHeader, if it exists. |
void |
setRowHeaderView(Component view)
Creates a row-header viewport if necessary, sets its view and then adds the row-header viewport to the scrollpane. |
void |
setViewport(JViewport viewport)
Removes the old viewport (if there is one); forces the viewPosition of the new viewport to be in the +x,+y quadrant; syncs up the row and column headers (if there are any) with the new viewport; and finally syncs the scrollbars and headers with the new viewport. |
void |
setViewportView(Component view)
Creates a viewport if necessary and then sets its view. |
void |
validateTree()
Recursively descends the container tree and recomputes the layout for any subtrees marked as needing it (those marked as invalid). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LockedTableModel lockedTableModel
protected boolean containsViewable
Constructor Detail |
---|
public AdvancedJScrollPane()
public AdvancedJScrollPane(int vsbPolicy, int hsbPolicy)
public AdvancedJScrollPane(Component view)
public AdvancedJScrollPane(Component view, int vsbPolicy, int hsbPolicy)
Method Detail |
---|
public int convertBackX(int x)
x
- the x-coordinate to convert
public int convertBackY(int y)
y
- the y-coordinate to convert
public int convertX(int x)
x
- the x-coordinate to convert
public int convertX(int x, int delta)
x
- the x-coordinate to convertdelta
- the distance a column was dragged
public int convertY(int y)
y
- the y-coordinate to convert
protected LockedTableModel createDefaultLockedModel()
public JScrollBar createHorizontalScrollBar()
createHorizontalScrollBar
in class JScrollPane
JScrollBar
public void doLayout()
doLayout
in class Container
LayoutManager.layoutContainer(java.awt.Container)
,
Container.setLayout(java.awt.LayoutManager)
,
Container.validate()
public boolean getContainsViewable()
viewable resizer
.
public LockedTableModel getLockedModel()
public void layout()
layout
in class Container
public Component prepareEditorComponent(TableCellEditor editor, Component c, int row, int column)
editor
- the table's cell editor that prepared the componentc
- the component being edited, as it came from the JTable.prepareEditor methodrow
- the row of the cell to edit, where 0 is the firstcolumn
- the column of the cell to edit, where 0 is the first
public void setColumnHeader(JViewport viewport)
null
, sync the x coordinate of the its viewPosition
with the viewport (if there is one) and then add it to the scrollpane.
Most applications will find it more convenient to use
setRowHeaderView
to add a row header component and its viewport to the scrollpane.
setColumnHeader
in class JScrollPane
JScrollPane.getColumnHeader()
,
JScrollPane.setColumnHeaderView(java.awt.Component)
public void setColumnHeaderView(Component view)
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setColumnHeaderView(myBigComponentsColumnHeader);
setColumnHeaderView
in class JScrollPane
view
- the component to display as the column headerJScrollPane.setColumnHeader(javax.swing.JViewport)
,
JViewport.setView(java.awt.Component)
public void setContainsViewable(boolean containsViewable)
viewable resizer
functionality in the scrollpane.
containsViewable
- true if the scrollpane is configured to use a viewable resizer,
false otherwisepublic void setLockedModel(LockedTableModel lockedTableModel)
lockedTableModel
- the locked table model to assign.public void setRowHeader(JViewport viewport)
null
, syncs the y coordinate of its
viewPosition with
the viewport (if there is one) and then adds it to the scrollpane.
Most applications will find it more convenient to use
setRowHeaderView
to add a row header component and its viewport to the scrollpane.
setRowHeader
in class JScrollPane
viewport
- the new row header to be used; if null
the old row header is still removed and the new rowHeader
is set to null
JScrollPane.getRowHeader()
,
JScrollPane.setRowHeaderView(java.awt.Component)
public void setRowHeaderView(Component view)
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll); scrollpane.setRowHeaderView(myBigComponentsRowHeader);
setRowHeaderView
in class JScrollPane
view
- the component to display as the row headerJScrollPane.setRowHeader(javax.swing.JViewport)
,
JViewport.setView(java.awt.Component)
public void setViewport(JViewport viewport)
Most applications will find it more convenient to use
setViewportView
to add a viewport and a view to the scrollpane.
setViewport
in class JScrollPane
viewport
- the new viewport to be used; if viewport is
null
, the old viewport is still removed
and the new viewport is set to null
JScrollPane.createViewport()
,
JScrollPane.getViewport()
,
JScrollPane.setViewportView(java.awt.Component)
public void setViewportView(Component view)
JScrollPane
constructor
should use this method to specify the scrollable child that's going
to be displayed in the scrollpane. For example:
JScrollPane scrollpane = new JScrollPane(); scrollpane.setViewportView(myBigComponentToScroll);Applications should not add children directly to the scrollpane.
setViewportView
in class JScrollPane
view
- the component to add to the viewportJScrollPane.setViewport(javax.swing.JViewport)
,
JViewport.setView(java.awt.Component)
public void validateTree()
validate
.
validateTree
in class Container
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |