|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.jidesoft.gantt.GanttChart<T,S>
T
- The type of the bases unit of the scale, for example Date or Integer.S
- The type of the GanttEnty in the model.public class GanttChart<T,S extends GanttEntry<T>>
Nested Class Summary |
---|
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
PROPERTY_EDITABLE
|
static String |
PROPERTY_GANTT_MODEL
|
static String |
PROPERTY_GRID_COLOR
|
static String |
PROPERTY_LABEL_ENTRY_GAP
|
static String |
PROPERTY_LABEL_POSITION
|
static String |
PROPERTY_ROW_HEIGHT
|
static String |
PROPERTY_ROW_MARGIN
|
static String |
PROPERTY_SCALE_AREA
|
static String |
PROPERTY_SHOW_GRID
|
static String |
PROPERTY_VIEW_MODE
|
static int |
VIEW_MODE_EDITING
|
static int |
VIEW_MODE_PANNING
|
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 | |
---|---|
GanttChart()
|
|
GanttChart(GanttModel<T,S> model)
|
|
GanttChart(GanttModel<T,S> model,
ScaleArea<T> scaleArea)
|
|
GanttChart(ScaleArea<T> scaleArea)
|
Method Summary | |
---|---|
void |
addNotify()
Calls the configureEnclosingScrollPane method. |
void |
addPeriodBackgroundPainter(int index,
PeriodBackgroundPainter<T> painter)
Adds a painter to chart to paint behind the Gantt entries. |
void |
addPeriodBackgroundPainter(PeriodBackgroundPainter<T> painter)
|
void |
addSelectionInterval(int index0,
int index1)
Adds the rows from index0 to index1 , inclusive, to the current selection. |
void |
autoResizePeriods(boolean visibleRowsOnly)
Automatically resizes the periods width and changes the visible periods to fit the range of the GanttModel. |
void |
changeSelection(int rowIndex,
boolean toggle,
boolean extend)
Updates the selection models of the table, depending on the state of the two flags: toggle and
extend . |
void |
clearSelection()
Deselects all selected entries. |
protected void |
configureEnclosingScrollPane()
If this GanttChart is the viewportView of an enclosing JScrollPane (the
usual situation), configure this ScrollPane by, amongst other things, installing the table's
scaleArea as the columnHeaderView of the scroll pane. |
protected ListSelectionModel |
createDefaultSelectionModel()
Returns the default selection model object, which is a DefaultListSelectionModel . |
void |
ensureRowIsVisible(int index)
Scrolls the list within an enclosing viewport to make the specified cell completely visible. |
void |
ganttChartChanged(GanttModelEvent e)
This method notifies the listeners that something is changed in the GanttModel . |
void |
ganttEntryRelationChanged(GanttEntryRelationEvent e)
|
int |
getAnchorSelectionIndex()
Returns the anchor selection index. |
GanttEntryRenderer |
getDefaultEntryRenderer()
Gets the default GanttEntryRenderer. |
GanttLabelRenderer |
getDefaultLabelRenderer()
Gets the default GanttLabelRenderer. |
S |
getEntryAt(int index)
Gets the gantt entry by index. |
S |
getEntryAt(int index,
int subEntryIndex)
Gets the gantt entry by index and sub entry index. |
S |
getEntryAt(Point point)
Gets the gantt entry at the point. |
int |
getEntryCount()
Gets the count of entries inside the gantt model. |
Rectangle |
getEntryRect(GanttEntry<T> entry,
int row)
|
Rectangle |
getEntryRect(int row)
Returns a rectangle for the row, clipped by the Range of the GanttEntry at that row. |
GanttEntryRenderer |
getEntryRenderer(int row)
Returns an appropriate renderer for the row specified by the row index. |
GanttEntryRenderer |
getEntryRenderer(int row,
int column)
Returns an appropriate renderer for the row specified by the row index. |
Color |
getGridColor()
Returns the color used to draw grid lines. |
int |
getIndexOf(S entry)
Gets the index of gantt entry. |
int |
getLabelEntryGap()
Gets the gap between the label and the entry. |
int |
getLabelPosition()
Gets the label position relative to the entry. |
GanttLabelRenderer |
getLabelRenderer(int row)
Returns an appropriate renderer for the row specified by the row index. |
GanttLabelRenderer |
getLabelRenderer(int row,
int column)
Returns an appropriate renderer for the row specified by the row index. |
int |
getLeadSelectionIndex()
Returns the lead selection index. |
int |
getMaxSelectionIndex()
Returns the largest selected cell index, or -1 if the selection is empty. |
int |
getMinSelectionIndex()
Returns the smallest selected cell index, or -1 if the selection is empty. |
GanttModel<T,S> |
getModel()
|
List<PeriodBackgroundPainter<T>> |
getPeriodBackgroundPainters()
|
Dimension |
getPreferredScrollableViewportSize()
|
GanttEntryRelationPainter |
getRelationPainter(int relationType)
|
int |
getResizeAreaWidth()
Gets the pixels for the width of the resize area. |
String |
getResourceString(String key)
Gets the localized string from resource bundle. |
int |
getRowHeight()
Returns the height of a table row, in pixels. |
int |
getRowHeight(int row)
Returns the height, in pixels, of the cells in row . |
int |
getRowMargin()
Gets the amount of empty space, in pixels, between cells. |
Rectangle |
getRowRect(int row,
boolean includingSpacing)
|
ScaleArea<T> |
getScaleArea()
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
|
int |
getSelectedRow()
Returns the index of the first selected entry, -1 if no entry is selected. |
int |
getSelectedRowCount()
Returns the number of selected entries. |
int[] |
getSelectedRows()
Returns the indices of all selected entries. |
Color |
getSelectionBackground()
Returns the background color for selected cells. |
Color |
getSelectionForeground()
Returns the foreground color for the rows of the selected entries. |
int |
getSelectionMode()
Returns the current selection mode for the list. |
ListSelectionModel |
getSelectionModel()
|
String |
getToolTipText(MouseEvent event)
|
int |
getTotalRowHeight()
|
GanttChartUI |
getUI()
|
String |
getUIClassID()
|
boolean |
getValueIsAdjusting()
Returns the value of the selection model's isAdjusting property. |
int |
getViewMode()
|
boolean |
isAllowMoveEntry()
Gets the flag indicating if drag and move gantt entry is allowed. |
boolean |
isAllowResizeEntry(GanttEntry<T> entry,
T start,
T end)
Checks if the entry is allowed to be resized as designated start & end. |
boolean |
isEditable()
|
boolean |
isResizeEastArea(Point point,
Rectangle entryRect)
Checks if the point is in the resize east area. |
boolean |
isResizeWestArea(Point point,
Rectangle entryRect)
Checks if the point is in the resize west area. |
boolean |
isRowHeightSet()
|
boolean |
isRowSelected(int index)
Returns true if the specified index is in the valid range of entries, and the entry at that index is selected. |
boolean |
isShowGrid()
|
Component |
prepareLabelRenderer(GanttLabelRenderer renderer,
int row)
Prepares the renderer by querying the data model for the value and selection state of the cell at row , column . |
Component |
prepareLabelRenderer(GanttLabelRenderer renderer,
int row,
int column)
Prepares the renderer by querying the data model for the value and selection state of the cell at row , column . |
Component |
prepareRenderer(GanttEntryRenderer renderer,
int row,
Insets insets)
Deprecated. replaced by prepareRenderer(GanttEntryRenderer, int, int, java.awt.Insets) |
Component |
prepareRenderer(GanttEntryRenderer renderer,
int row,
int column,
Insets insets)
Prepares the renderer by querying the data model for the value and selection state of the cell at row , column . |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removePeriodBackgroundPainter(PeriodBackgroundPainter<T> painter)
|
void |
removeSelectionInterval(int index0,
int index1)
Deselects the rows from index0 to index1 , inclusive. |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
|
protected void |
resizeAndRepaint()
Equivalent to revalidate followed by repaint . |
int |
rowAtPoint(Point point)
Returns the index of the row that point lies in, or -1 if the result is not in the range [0,
getRowCount() -1]. |
void |
scrollRowToVisible(int rowIndex)
|
void |
scrollSpanToVisible(Range<T> span)
|
void |
scrollSpanToVisible(T start,
T end)
|
void |
selectAll()
|
void |
setAllowMoveEntry(boolean allowMoveEntry)
Sets the flag indicating if drag and move gantt entry is allowed. |
void |
setDefaultEntryRenderer(GanttEntryRenderer defaultEntryRenderer)
Sets the default GanttEntryRenderer. |
void |
setDefaultLabelRenderer(GanttLabelRenderer defaultLabelRenderer)
Sets the default GanttLabelRenderer. |
void |
setEditable(boolean editable)
|
void |
setGridColor(Color gridColor)
Sets the color used to draw grid lines to gridColor and redisplays. |
void |
setLabelEntryGap(int labelEntryGap)
Sets the label and the entry gap. |
void |
setLabelPosition(int labelPosition)
Sets the label position. |
void |
setModel(GanttModel<T,S> model)
|
void |
setRelationPainter(int relationType,
GanttEntryRelationPainter painter)
|
void |
setResizeAreaWidth(int resizeAreaWidth)
Sets the pixels for the width of the resize area. |
void |
setRowHeight(int rowHeight)
Sets the height, in pixels, of all cells to rowHeight , revalidates, and repaints. |
void |
setRowHeight(int row,
int rowHeight)
Sets the height for row to rowHeight , revalidates, and repaints. |
void |
setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows. |
void |
setScaleArea(ScaleArea<T> scaleArea)
|
void |
setSelectedIndex(int index)
Selects a single cell. |
void |
setSelectionBackground(Color selectionBackground)
Sets the background color for selected cells. |
void |
setSelectionForeground(Color selectionForeground)
Sets the foreground color for the rows of the selected entries. |
void |
setSelectionInterval(int index0,
int index1)
Selects the rows from index0 to index1 , inclusive. |
void |
setSelectionMode(int selectionMode)
Sets the gantt chart's selection mode to allow only single selections, a single contiguous interval, or multiple intervals. |
void |
setSelectionModel(ListSelectionModel selectionModel)
|
void |
setShowGrid(boolean showGrid)
Sets whether the table draws grid lines around cells. |
protected void |
setUI(GanttChartUI newUI)
|
void |
setValueIsAdjusting(boolean b)
Sets the selection model's valueIsAdjusting property. |
void |
setViewMode(int viewMode)
If enabled, mouse editing and mouse drag selection is disabled. |
void |
updateUI()
|
void |
valueChanged(ListSelectionEvent e)
|
void |
zoomInPeriods()
|
void |
zoomOutPeriods()
|
void |
zoomPeriods(double factor)
|
void |
zoomPeriods(T start,
T end)
Automatically resizes the periods width and changes the visible periods to fit the specified range. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_SCALE_AREA
public static final String PROPERTY_GANTT_MODEL
public static final String PROPERTY_EDITABLE
public static final String PROPERTY_VIEW_MODE
public static final String PROPERTY_ROW_HEIGHT
public static final String PROPERTY_ROW_MARGIN
public static final String PROPERTY_GRID_COLOR
public static final String PROPERTY_SHOW_GRID
public static final String PROPERTY_LABEL_POSITION
public static final String PROPERTY_LABEL_ENTRY_GAP
public static final int VIEW_MODE_EDITING
public static final int VIEW_MODE_PANNING
Constructor Detail |
---|
public GanttChart()
public GanttChart(GanttModel<T,S> model)
public GanttChart(ScaleArea<T> scaleArea)
public GanttChart(GanttModel<T,S> model, ScaleArea<T> scaleArea)
Method Detail |
---|
public void setScaleArea(ScaleArea<T> scaleArea)
public ScaleArea<T> getScaleArea()
public GanttModel<T,S> getModel()
public boolean isEditable()
public void setEditable(boolean editable)
public void ganttEntryRelationChanged(GanttEntryRelationEvent e)
ganttEntryRelationChanged
in interface GanttEntryRelationListener
public void ganttChartChanged(GanttModelEvent e)
GanttModelListener
GanttModel
.
ganttChartChanged
in interface GanttModelListener
e
- the GanttModelEvent.public void setModel(GanttModel<T,S> model)
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
protected void setUI(GanttChartUI newUI)
public String getUIClassID()
getUIClassID
in class JComponent
public GanttChartUI getUI()
public void updateUI()
updateUI
in class JComponent
public void addNotify()
configureEnclosingScrollPane
method.
addNotify
in class JComponent
configureEnclosingScrollPane()
protected void configureEnclosingScrollPane()
GanttChart
is the viewportView
of an enclosing JScrollPane
(the
usual situation), configure this ScrollPane
by, amongst other things, installing the table's
scaleArea
as the columnHeaderView
of the scroll pane. When a GanttChart
is
added to a JScrollPane
in the usual way, using new JScrollPane(myGanttChart)
,
addNotify
is called in the GanttChart
(when the table is added to the viewport).
GanttChart
's addNotify
method in turn calls this method, which is protected so that
this default installation procedure can be overridden by a subclass.
addNotify()
public int getEntryCount()
public S getEntryAt(Point point)
point
- the mouse point
public S getEntryAt(int index)
index
- the index
public S getEntryAt(int index, int subEntryIndex)
index
- the indexsubEntryIndex
- the sub entry index
public int getIndexOf(S entry)
entry
- the gantt entry
protected void resizeAndRepaint()
revalidate
followed by repaint
.
public void setRowHeight(int rowHeight)
rowHeight
, revalidates, and repaints. The height of the
cells will be equal to the row height minus the row margin.
rowHeight
- new row height
IllegalArgumentException
- if rowHeight
is less than 1public boolean isRowHeightSet()
public int getRowHeight()
setRowHeight(int)
public int getTotalRowHeight()
public void setRowHeight(int row, int rowHeight)
row
to rowHeight
, revalidates, and repaints. The height of the
cells in this row will be equal to the row height minus the row margin.
row
- the row whose height is being changedrowHeight
- new row height, in pixels
IllegalArgumentException
- if rowHeight
is less than 1public int getRowHeight(int row)
row
.
row
- the row whose height is to be returned
public void setRowMargin(int rowMargin)
rowMargin
- the number of pixels between cells in a rowgetRowMargin()
public int getRowMargin()
getIntercellSpacing().height
.
setRowMargin(int)
public void setGridColor(Color gridColor)
gridColor
and redisplays. The default color is look and
feel dependent.
gridColor
- the new color of the grid lines
IllegalArgumentException
- if gridColor
is null
public Color getGridColor()
setGridColor(java.awt.Color)
public void setShowGrid(boolean showGrid)
showGrid
is true it does; if it is false it
doesn't.
showGrid
- true if table view should draw grid linespublic boolean isShowGrid()
public void setViewMode(int viewMode)
viewMode
- the new view mode.public int getViewMode()
public int rowAtPoint(Point point)
point
lies in, or -1 if the result is not in the range [0,
getRowCount()
-1].
point
- the location of interest
point
lies in, or -1 if the result is not in the range [0,
getRowCount()
-1]public String getToolTipText(MouseEvent event)
getToolTipText
in class JComponent
public Rectangle getEntryRect(int row)
Range
of the GanttEntry
at that row. If there is
no entry at the row or the range of the entry is null
or has a null
lower or upper
boundary, null
is returned.
row
- the row index.
public Rectangle getEntryRect(GanttEntry<T> entry, int row)
public Rectangle getRowRect(int row, boolean includingSpacing)
public void autoResizePeriods(boolean visibleRowsOnly)
true
the periods are resized to fit the union of the range of the GanttEntries of
the currently visible rows.
If no valid range can be found (either null
or the start or end is null
) the periods
are changed to fit the default range of the ScaleModel.
visibleRowsOnly
- true
if the periods should be resized to combined range of the GanttEntries
of the visible rows.zoomPeriods(T, T)
,
GanttModel.getRange()
public void zoomPeriods(T start, T end)
start
- The start of the range (not null).end
- The end of the range (not null).public void zoomInPeriods()
public void zoomOutPeriods()
public void zoomPeriods(double factor)
public void scrollSpanToVisible(Range<T> span)
public void scrollSpanToVisible(T start, T end)
public void scrollRowToVisible(int rowIndex)
public GanttEntryRenderer getEntryRenderer(int row)
row
- the row of the cell to render, where 0 is the first row
public GanttEntryRenderer getEntryRenderer(int row, int column)
row
- the row of the cell to render, where 0 is the first rowcolumn
- the column index of the sub entry. -1 if there is no sub entry
public GanttEntryRenderer getDefaultEntryRenderer()
public void setDefaultEntryRenderer(GanttEntryRenderer defaultEntryRenderer)
defaultEntryRenderer
- the new default GanttEntryRenderer.public GanttLabelRenderer getLabelRenderer(int row)
row
- the row of the cell to render, where 0 is the first row
public GanttLabelRenderer getLabelRenderer(int row, int column)
row
- the row of the cell to render, where 0 is the first rowcolumn
- the column index of the sub entry. -1 if there is no sub entry
public GanttLabelRenderer getDefaultLabelRenderer()
public void setDefaultLabelRenderer(GanttLabelRenderer defaultLabelRenderer)
defaultLabelRenderer
- the new default GanttLabelRenderer.public int getLabelPosition()
public void setLabelPosition(int labelPosition)
labelPosition
- the label position.public int getLabelEntryGap()
public void setLabelEntryGap(int labelEntryGap)
labelEntryGap
- the gap between the label and the entry.@Deprecated public Component prepareRenderer(GanttEntryRenderer renderer, int row, Insets insets)
prepareRenderer(GanttEntryRenderer, int, int, java.awt.Insets)
row
, column
. Returns the component (may be a Component
or a
JComponent
) under the event location.
During a printing operation, this method will configure the renderer without indicating selection or focus, to
prevent them from appearing in the printed output. To do other customizations based on whether or not the table
is being printed, you can check the value of JComponent#isPaintingForPrint(), either here or within custom
renderers.
renderer
- the TableCellRenderer
to preparerow
- the row of the cell to render, where 0 is the first rowinsets
- the insets of the component
Component
under the event locationpublic Component prepareRenderer(GanttEntryRenderer renderer, int row, int column, Insets insets)
row
, column
. Returns the component (may be a Component
or a
JComponent
) under the event location.
During a printing operation, this method will configure the renderer without indicating selection or focus, to
prevent them from appearing in the printed output. To do other customizations based on whether or not the table
is being printed, you can check the value of JComponent#isPaintingForPrint(), either here or within custom
renderers.
renderer
- the TableCellRenderer
to preparerow
- the row of the cell to render, where 0 is the first rowcolumn
- the column index of the sub entry. -1 if there is no sub entryinsets
- the insets of the component
Component
under the event locationpublic Component prepareLabelRenderer(GanttLabelRenderer renderer, int row)
row
, column
. Returns the component (may be a Component
or a
JComponent
) under the event location.
During a printing operation, this method will configure the renderer without indicating selection or focus, to
prevent them from appearing in the printed output. To do other customizations based on whether or not the table
is being printed, you can check the value of JComponent#isPaintingForPrint(), either here or within custom
renderers.
renderer
- the TableCellRenderer
to preparerow
- the row of the cell to render, where 0 is the first row
Component
under the event locationpublic Component prepareLabelRenderer(GanttLabelRenderer renderer, int row, int column)
row
, column
. Returns the component (may be a Component
or a
JComponent
) under the event location.
During a printing operation, this method will configure the renderer without indicating selection or focus, to
prevent them from appearing in the printed output. To do other customizations based on whether or not the table
is being printed, you can check the value of JComponent#isPaintingForPrint(), either here or within custom
renderers.
renderer
- the TableCellRenderer
to preparerow
- the row of the cell to render, where 0 is the first rowcolumn
- the column index of the sub entry. -1 if there is no sub entry
Component
under the event locationpublic GanttEntryRelationPainter getRelationPainter(int relationType)
public void setRelationPainter(int relationType, GanttEntryRelationPainter painter)
public List<PeriodBackgroundPainter<T>> getPeriodBackgroundPainters()
public void addPeriodBackgroundPainter(PeriodBackgroundPainter<T> painter)
public void addPeriodBackgroundPainter(int index, PeriodBackgroundPainter<T> painter)
Painters paint in order of index with later painters overwriting the previous ones if they paint in the same location (unless painting with transparent colors).
index
- the location in the painter listpainter
- the PeriodBackgroundPainter which paints the backgroundpublic void removePeriodBackgroundPainter(PeriodBackgroundPainter<T> painter)
public int getSelectionMode()
setSelectionMode(int)
public ListSelectionModel getSelectionModel()
public void setSelectionModel(ListSelectionModel selectionModel)
public void setSelectionMode(int selectionMode)
selectionMode
- the new selection modepublic void clearSelection()
public void selectAll()
public void setSelectedIndex(int index)
setSelectionInterval
on the selection model. Refer to the documentation for
the selection model class being used for details on how values less than 0
are handled.
index
- the index of the cell to selectListSelectionModel.setSelectionInterval(int, int)
public void setSelectionInterval(int index0, int index1)
index0
to index1
, inclusive.
index0
- one end of the intervalindex1
- the other end of the interval
IllegalArgumentException
- if index0
or index1
lie outside [0,
getRowCount()
-1]public void addSelectionInterval(int index0, int index1)
index0
to index1
, inclusive, to the current selection.
index0
- one end of the intervalindex1
- the other end of the interval
IllegalArgumentException
- if index0
or index1
lie outside [0,
getRowCount()
-1]public void removeSelectionInterval(int index0, int index1)
index0
to index1
, inclusive.
index0
- one end of the intervalindex1
- the other end of the interval
IllegalArgumentException
- if index0
or index1
lie outside [0,
getRowCount()
-1]public int getSelectedRow()
public int[] getSelectedRows()
getSelectedRow()
public int getSelectedRowCount()
public int getAnchorSelectionIndex()
ListSelectionModel.getAnchorSelectionIndex()
public int getLeadSelectionIndex()
ListSelectionModel.getLeadSelectionIndex()
public int getMinSelectionIndex()
-1
if the selection is empty. This is a cover method that
delegates to the method of the same name on the list's selection model.
-1
ListSelectionModel.getMinSelectionIndex()
public int getMaxSelectionIndex()
-1
if the selection is empty. This is a cover method that
delegates to the method of the same name on the list's selection model.
ListSelectionModel.getMaxSelectionIndex()
public void setValueIsAdjusting(boolean b)
valueIsAdjusting
property. When true
, upcoming changes to selection
should be considered part of a single change. This property is used internally and developers typically need not
call this method. For example, when the model is being updated in response to a user drag, the value of the
property is set to true
when the drag is initiated and set to false
when the drag is finished.
This allows listeners to update only when a change has been finalized, rather than handling all of the
intermediate values.
You may want to use this directly if making a series of changes that should be considered part of a single
change.
This is a cover method that delegates to the method of the same name on the list's selection model. See the
documentation for ListSelectionModel.setValueIsAdjusting(boolean)
for more details.
b
- the new value for the propertyListSelectionModel.setValueIsAdjusting(boolean)
,
ListSelectionEvent.getValueIsAdjusting()
,
getValueIsAdjusting()
public boolean getValueIsAdjusting()
isAdjusting
property.
This is a cover method that delegates to the method of the same name on the list's selection model.
isAdjusting
property.setValueIsAdjusting(boolean)
,
ListSelectionModel.getValueIsAdjusting()
public boolean isRowSelected(int index)
index
- the entry index
row
is a valid index and the entry at that index is selected (where 0 is the first
entry)public void changeSelection(int rowIndex, boolean toggle, boolean extend)
toggle
and
extend
. Most changes to the selection that are the result of keyboard or mouse events received by
the UI are channeled through this method so that the behavior may be overridden by a subclass. Some UIs may need
more functionality than this method provides, such as when manipulating the lead for discontiguous selection, and
may not call into this method for some selection changes.
This implementation uses the following conventions: toggle
: false,
extend
: false. Clear the previous selection and ensure the new cell is selected. toggle
: false, extend
: true. Extend the previous selection from the
anchor to the specified cell, clearing all other selections. toggle
: true,
extend
: false. If the specified cell is selected, deselect it. If it is not selected,
select it. toggle
: true, extend
: true. Apply the selection state
of the anchor to all cells between it and the specified cell.
rowIndex
- affects the selection at row
toggle
- see description aboveextend
- if true, extend the current selectionpublic Color getSelectionForeground()
Color
object for the foreground propertysetSelectionForeground(java.awt.Color)
,
setSelectionBackground(java.awt.Color)
public void setSelectionForeground(Color selectionForeground)
selectionForeground
- the Color
to use in the foreground for selected list itemsgetSelectionForeground()
,
setSelectionBackground(java.awt.Color)
,
JComponent.setForeground(java.awt.Color)
,
JComponent.setBackground(java.awt.Color)
,
JComponent.setFont(java.awt.Font)
public Color getSelectionBackground()
Color
used for the background of selected list itemssetSelectionBackground(java.awt.Color)
,
setSelectionForeground(java.awt.Color)
public void setSelectionBackground(Color selectionBackground)
selectionBackground
- the Color
to use for the background of selected cellsgetSelectionBackground()
,
setSelectionForeground(java.awt.Color)
,
JComponent.setForeground(java.awt.Color)
,
JComponent.setBackground(java.awt.Color)
,
JComponent.setFont(java.awt.Font)
protected ListSelectionModel createDefaultSelectionModel()
DefaultListSelectionModel
. A subclass can
override this method to return a different selection model object.
DefaultListSelectionModel
public void ensureRowIsVisible(int index)
scrollRectToVisible
with the bounds of the specified cell. For this method to work, the JList
must be
within a JViewport
.
If the given index is outside the list's range of cells, this method results in nothing.
index
- the index of the cell to make visibleJComponent.scrollRectToVisible(java.awt.Rectangle)
,
JComponent.getVisibleRect()
public void repaint(long tm, int x, int y, int width, int height)
repaint
in class JComponent
public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
public String getResourceString(String key)
key
- the resource string key
public boolean isAllowMoveEntry()
setAllowMoveEntry(boolean)
public void setAllowMoveEntry(boolean allowMoveEntry)
allowMoveEntry
- the flagpublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public int getResizeAreaWidth()
public void setResizeAreaWidth(int resizeAreaWidth)
resizeAreaWidth
- the pixels for the width of the resize areapublic boolean isResizeWestArea(Point point, Rectangle entryRect)
point
- the mouse pointentryRect
- the rectangle of the entry area
public boolean isResizeEastArea(Point point, Rectangle entryRect)
point
- the mouse pointentryRect
- the rectangle of the entry area
public boolean isAllowResizeEntry(GanttEntry<T> entry, T start, T end)
entry
- the gantt entrystart
- the new start of the rangeend
- the new end of the range
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |