public class ChartLayout
extends org.eclipse.swt.widgets.Layout
Modifier and Type | Class and Description |
---|---|
private static class |
ChartLayout.AxisLayoutData
Axis layout data.
|
Modifier and Type | Field and Description |
---|---|
private Axis[] |
axes
the axes
|
private java.util.Map<Axis,ChartLayout.AxisLayoutData> |
axisLayoutDataMap
the map between axis and axis layout data
|
private int |
bottomAxisHeight
the bottom axis height
|
private int |
bottomAxisOffset
the offset for bottom axis
|
private Axis[] |
horizontalAxes
the horizontal axes
|
private int |
leftAxisOffset
the offset for left axis
|
private int |
leftAxisWidth
the left axis width
|
private Legend |
legend
the legend
|
private int |
legendHeight
the legend height
|
private int |
legendWidth
the legend width
|
static int |
MARGIN
the margin
|
static int |
PADDING
the padding
|
private PlotArea |
plot
the plot area
|
private int |
plotAreaHeight
the plot area height
|
private int |
plotAreaWidth
the plot area width
|
private int |
rightAxisOffset
the offset for right axis
|
private int |
rightAxisWidth
the right axis width
|
private ChartTitle |
title
the chart title
|
private int |
titleHeight
the title height
|
private int |
titleWidth
the title width
|
private int |
topAxisHeight
the top axis height
|
private int |
topAxisOffset
the offset for top axis
|
private Axis[] |
verticalAxes
the vertical axes
|
Constructor and Description |
---|
ChartLayout()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
adjustForMostLeftRightTickLabel(org.eclipse.swt.graphics.Rectangle r)
Adjust the axis size for most left/right tick label.
|
private void |
adjustForRotatedTickLabels(org.eclipse.swt.graphics.Rectangle r)
Adjust the axis size for rotated tick labels.
|
private void |
computeAxisSize(org.eclipse.swt.graphics.Rectangle r)
Computes the size of axes updating tick labels.
|
private void |
computePlotAreaSize(org.eclipse.swt.graphics.Rectangle r)
Computes the size of plot area.
|
protected org.eclipse.swt.graphics.Point |
computeSize(org.eclipse.swt.widgets.Composite composite,
int wHint,
int hHint,
boolean flushCache) |
private void |
initAxisSize()
Initializes the size of axes.
|
private void |
initTitleAndLegendSize()
Initializes the size of title and legend.
|
private void |
initWidgetSizeVariables()
Initializes the size variables of widgets.
|
protected void |
layout(org.eclipse.swt.widgets.Composite composite,
boolean flushCache) |
private void |
layoutAxes(org.eclipse.swt.graphics.Rectangle r)
Layouts the axes.
|
private void |
layoutBottomAxis(org.eclipse.swt.graphics.Rectangle r,
ChartLayout.AxisLayoutData layoutData)
Layouts the bottom axis.
|
private void |
layoutLeftAxis(org.eclipse.swt.graphics.Rectangle r,
ChartLayout.AxisLayoutData layoutData)
Layouts the left axis.
|
private void |
layoutLegend(org.eclipse.swt.graphics.Rectangle r)
Layouts the legend.
|
private void |
layoutPlot(org.eclipse.swt.graphics.Rectangle r)
Layouts the plot.
|
private void |
layoutRightAxis(org.eclipse.swt.graphics.Rectangle r,
ChartLayout.AxisLayoutData layoutData)
Layouts the right axis.
|
private void |
layoutTitle(org.eclipse.swt.graphics.Rectangle r)
Layouts the title.
|
private void |
layoutTopAxis(org.eclipse.swt.graphics.Rectangle r,
ChartLayout.AxisLayoutData layoutData)
Layouts the top axis.
|
private boolean |
parseControls(org.eclipse.swt.widgets.Composite composite)
Parses the controls on given composite.
|
private void |
updateHorizontalAxisTick()
Updates the horizontal axis tick.
|
private void |
updateVerticalAxisTick()
Updates the vertical axis tick.
|
private int titleHeight
private int titleWidth
private int legendWidth
private int legendHeight
private int bottomAxisHeight
private int topAxisHeight
private int leftAxisWidth
private int rightAxisWidth
private int plotAreaWidth
private int plotAreaHeight
private ChartTitle title
private Legend legend
private PlotArea plot
private Axis[] axes
private Axis[] horizontalAxes
private Axis[] verticalAxes
private java.util.Map<Axis,ChartLayout.AxisLayoutData> axisLayoutDataMap
private int bottomAxisOffset
private int topAxisOffset
private int leftAxisOffset
private int rightAxisOffset
public static final int MARGIN
public static final int PADDING
private void initWidgetSizeVariables()
protected org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.widgets.Composite composite, int wHint, int hHint, boolean flushCache)
computeSize
in class org.eclipse.swt.widgets.Layout
protected void layout(org.eclipse.swt.widgets.Composite composite, boolean flushCache)
layout
in class org.eclipse.swt.widgets.Layout
private boolean parseControls(org.eclipse.swt.widgets.Composite composite)
composite
- the compositeprivate void initTitleAndLegendSize()
private void initAxisSize()
private void computePlotAreaSize(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void computeAxisSize(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void adjustForRotatedTickLabels(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void adjustForMostLeftRightTickLabel(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void updateHorizontalAxisTick()
private void updateVerticalAxisTick()
private void layoutTitle(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void layoutLegend(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void layoutPlot(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void layoutAxes(org.eclipse.swt.graphics.Rectangle r)
r
- the rectangle to layoutprivate void layoutBottomAxis(org.eclipse.swt.graphics.Rectangle r, ChartLayout.AxisLayoutData layoutData)
r
- the rectanglelayoutData
- the layout dataprivate void layoutTopAxis(org.eclipse.swt.graphics.Rectangle r, ChartLayout.AxisLayoutData layoutData)
r
- the rectanglelayoutData
- the layout dataprivate void layoutLeftAxis(org.eclipse.swt.graphics.Rectangle r, ChartLayout.AxisLayoutData layoutData)
r
- the rectanglelayoutData
- the layout dataprivate void layoutRightAxis(org.eclipse.swt.graphics.Rectangle r, ChartLayout.AxisLayoutData layoutData)
r
- the rectanglelayoutData
- the layout data