|
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.scale.ScaleArea<T>
T
- The base unit value of the scale, for example Date or Integer.public class ScaleArea<T>
The scale area is the header of the gantt chart and can show the scale in different granularities.
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 int |
DEFAULT_PERIOD_HEIGHT
|
static int |
DEFAULT_PERIOD_WIDTH
|
static String |
PROPERTY_PERIOD_BACKGROUND_PAINTER
|
static String |
PROPERTY_PERIOD_CONVERTERS
|
static String |
PROPERTY_PERIOD_HEADER_PAINTER
|
static String |
PROPERTY_PERIOD_MARGIN
|
static String |
PROPERTY_PREFERRED_PERIOD_SIZE
|
static String |
PROPERTY_SCALE_END
|
static String |
PROPERTY_SCALE_MODEL
Also implies a scale start, scale end and visible periods change. |
static String |
PROPERTY_SCALE_START
|
static String |
PROPERTY_TABLE_CELL_RENDERER
|
static String |
PROPERTY_TREE_TABLE
|
static String |
PROPERTY_VISIBLE_PERIOD_COUNT
|
static String |
PROPERTY_VISIBLE_PERIODS
|
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 | |
---|---|
ScaleArea()
|
|
ScaleArea(ScaleModel<T> scaleModel,
PeriodConverter<T> defaultConverter)
|
Method Summary | |
---|---|
void |
addPopupMenuCustomizer(ScaleAreaPopupMenuCustomizer<T> customizer)
|
PeriodConverter<T> |
getDefaultPeriodConverter()
|
T |
getEnd()
|
T |
getInstantAt(int x)
Note: the components left-to-right orientation is already taken into account. |
PeriodConverter<T> |
getPeriodConverter(Period period)
|
PeriodHeaderPainter |
getPeriodHeaderPainter()
|
int |
getPeriodMargin()
|
List<ScaleAreaPopupMenuCustomizer<T>> |
getPopupMenuCustomizers()
|
Dimension |
getPreferredPeriodSize()
|
String |
getResourceString(String key)
Gets the localized string from resource bundle. |
ScaleModel<T> |
getScaleModel()
|
Period |
getSmallestVisiblePeriod()
|
T |
getStart()
|
TableCellRenderer |
getTableCellRenderer()
|
String |
getToolTipText(MouseEvent event)
|
TreeTable |
getTreeTable()
|
ScaleAreaUI |
getUI()
|
String |
getUIClassID()
|
int |
getVisiblePeriodCount()
|
List<Period> |
getVisiblePeriods()
|
int |
getX(T instant)
Note: the components left-to-right orientation is already taken into account. |
boolean |
isPreferredPeriodSizeSet()
|
void |
removePopupMenuCustomizer(ScaleAreaPopupMenuCustomizer<T> customizer)
|
protected void |
resizeAndRepaint()
|
void |
setDefaultPeriodConverter(PeriodConverter<T> converter)
|
void |
setEnd(T end)
If the end instant is at or before than the current start instant, the start instant is moved to the smallest period end before the end. |
void |
setPeriodConverter(Period period,
PeriodConverter<T> converter)
Set the renderer for the specified period. |
void |
setPeriodHeaderPainter(PeriodHeaderPainter periodHeaderPainter)
|
void |
setPeriodMargin(int periodMargin)
|
void |
setPreferredPeriodSize(Dimension size)
|
void |
setPreferredSize(Dimension preferredSize)
|
void |
setScaleModel(ScaleModel<T> scaleModel)
Updates the model, start instant, end instant and visible periods. |
void |
setStart(T start)
If the start instant is at or after than the current end instant, the end instant is moved to the smallest period end after the start. |
void |
setTableCellRenderer(TableCellRenderer tableCellRenderer)
|
void |
setTreeTable(TreeTable treeTable)
|
protected void |
setUI(ScaleAreaUI newUI)
|
void |
setVisiblePeriodCount(int visiblePeriodCount)
Sets the preferred visible period count for the smallest visible period. |
void |
setVisiblePeriods(List<? extends Period> visiblePeriods)
|
void |
setVisiblePeriods(List<? extends Period> visiblePeriods,
boolean setPreferredTierCount)
|
void |
setVisiblePeriodsToFit(T start,
T end,
int availableWidth)
Adjusts the visible periods and preferred period width so the specified range is visible. |
void |
updateUI()
|
void |
zoomPeriodWidth(double factor)
|
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_MODEL
public static final String PROPERTY_VISIBLE_PERIODS
public static final String PROPERTY_SCALE_START
public static final String PROPERTY_SCALE_END
public static final String PROPERTY_PREFERRED_PERIOD_SIZE
public static final String PROPERTY_VISIBLE_PERIOD_COUNT
public static final String PROPERTY_PERIOD_MARGIN
public static final String PROPERTY_PERIOD_CONVERTERS
public static final String PROPERTY_PERIOD_HEADER_PAINTER
public static final String PROPERTY_PERIOD_BACKGROUND_PAINTER
public static final String PROPERTY_TREE_TABLE
public static final String PROPERTY_TABLE_CELL_RENDERER
public static final int DEFAULT_PERIOD_WIDTH
public static final int DEFAULT_PERIOD_HEIGHT
Constructor Detail |
---|
public ScaleArea()
public ScaleArea(ScaleModel<T> scaleModel, PeriodConverter<T> defaultConverter)
Method Detail |
---|
public void setScaleModel(ScaleModel<T> scaleModel)
scaleModel
- The new scale model
IllegalArgumentException
- If the ScaleModel does not define at least one Period.public ScaleModel<T> getScaleModel()
public void setVisiblePeriods(List<? extends Period> visiblePeriods)
visiblePeriods
- A sub set of the ScaleModels periods which should be shown.public void setVisiblePeriods(List<? extends Period> visiblePeriods, boolean setPreferredTierCount)
visiblePeriods
- A sub set of the ScaleModels periods which should be shown.setPreferredTierCount
- If true, the scale area will try to keep the amount of period the same when zooming
later.
IllegalArgumentException
- If visiblePeriods is null or empty or contains Periods not defined in the
ScaleModel.protected void resizeAndRepaint()
public List<Period> getVisiblePeriods()
public Period getSmallestVisiblePeriod()
public int getVisiblePeriodCount()
public void setVisiblePeriodCount(int visiblePeriodCount)
visiblePeriodCount
- The number of periods visible.public int getPeriodMargin()
public void setPeriodMargin(int periodMargin)
periodMargin
- The margin in pixels to the left and the right of the chart.public void setVisiblePeriodsToFit(T start, T end, int availableWidth)
start
- The start of the range (not null).end
- The end of the range (not null).availableWidth
- The available width in pixel (typically the GanttChart width).public void zoomPeriodWidth(double factor)
public T getStart()
public void setStart(T start)
ScaleModel.getDefaultStart()
.
start
- The first instant to be shown on the scale.
IllegalArgumentException
- If start is null.public T getEnd()
public void setEnd(T end)
ScaleModel.getDefaultEnd()
.
end
- The last instant to be shown on the scale.
IllegalArgumentException
- If end is null.public T getInstantAt(int x)
x
- The x-coordinate to the get the instant for.
public int getX(T instant)
instant
- The instant to get the screen position for.
public Dimension getPreferredPeriodSize()
public void setPreferredPeriodSize(Dimension size)
size
- The preferred size for the smallest visible Period.public void setPreferredSize(Dimension preferredSize)
setPreferredSize
in class JComponent
public boolean isPreferredPeriodSizeSet()
public PeriodConverter<T> getPeriodConverter(Period period)
public void setPeriodConverter(Period period, PeriodConverter<T> converter)
period
- the periodconverter
- the converter for the period.public PeriodConverter<T> getDefaultPeriodConverter()
public void setDefaultPeriodConverter(PeriodConverter<T> converter)
public String getToolTipText(MouseEvent event)
getToolTipText
in class JComponent
public void setPeriodHeaderPainter(PeriodHeaderPainter periodHeaderPainter)
public PeriodHeaderPainter getPeriodHeaderPainter()
public void setTreeTable(TreeTable treeTable)
public TreeTable getTreeTable()
public void setTableCellRenderer(TableCellRenderer tableCellRenderer)
public TableCellRenderer getTableCellRenderer()
public List<ScaleAreaPopupMenuCustomizer<T>> getPopupMenuCustomizers()
public void addPopupMenuCustomizer(ScaleAreaPopupMenuCustomizer<T> customizer)
public void removePopupMenuCustomizer(ScaleAreaPopupMenuCustomizer<T> customizer)
protected void setUI(ScaleAreaUI newUI)
public String getUIClassID()
getUIClassID
in class JComponent
public ScaleAreaUI getUI()
public void updateUI()
updateUI
in class JComponent
public String getResourceString(String key)
key
- the resource string key
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |