public class JSparklinesTwoValueBarChartTableCellRenderer extends JLabel implements TableCellRenderer
JLabel.AccessibleJLabel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JSparklinesTwoValueBarChartTableCellRenderer(org.jfree.chart.plot.PlotOrientation plotOrientation,
Double maxValue,
Color firstValueColor,
Color secondValueColor,
boolean showFirstNumber)
Creates a new JSparkLinesTableCellRenderer.
|
JSparklinesTwoValueBarChartTableCellRenderer(org.jfree.chart.plot.PlotOrientation plotOrientation,
Double maxValue,
Color firstValueColor,
Color secondValueColor,
Color fillColor,
boolean showFirstNumber)
Creates a new JSparkLinesTableCellRenderer.
|
Modifier and Type | Method and Description |
---|---|
void |
addReferenceArea(ReferenceArea referenceArea)
Add a reference area.
|
void |
addReferenceArea(String label,
double start,
double end,
Color areaColor,
float alpha)
Add a reference area.
|
void |
addReferenceLine(ReferenceLine referenceLine)
Add a reference line at a given data value.
|
void |
addReferenceLine(String label,
double value,
float lineWidth,
Color lineColor)
Add a reference line at a given data value.
|
HashMap<String,ReferenceArea> |
getAllReferenceAreas()
Returns all the references areas as a hashmap, with the labels as the
keys.
|
HashMap<String,ReferenceLine> |
getAllReferenceLines()
Returns all the references lines as a hashmap, with the labels as the
keys.
|
org.jfree.chart.ChartPanel |
getChartPanel()
Returns a reference to the chart panel.
|
Color |
getFirstValueColor()
Get the color used for the first value in the charts.
|
double |
getMaxValue()
Returns the maximum value.
|
org.jfree.chart.plot.PlotOrientation |
getPlotOrientation()
Get the current plot orientation.
|
Color |
getSecondValueColor()
Get the color used for the second value in the charts.
|
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) |
void |
removeAllReferenceAreas()
Removes all the reference areas.
|
void |
removeAllReferenceLines()
Removes all the reference lines.
|
void |
removeReferenceArea(String label)
Removes the reference area with the given label.
|
void |
removeReferenceLine(String label)
Removes the reference line with the given label.
|
void |
setBackgroundColor(Color color)
Set the background color.
|
void |
setFirstValueColor(Color firstValueColor)
Set the color used for the first value in the charts.
|
void |
setMaxValue(double maxValue)
Set the maximum value.
|
void |
setPlotOrientation(org.jfree.chart.plot.PlotOrientation plotOrientation)
Set the plot orientation.
|
void |
setSecondValueColor(Color secondValueColor)
Set the color used for the second value in the charts.
|
void |
showFirstNumber(boolean showFirstNumber)
If true, the first number is shown as the value.
|
void |
showNumberAndChart(boolean showNumberAndChart,
int widthOfLabel)
If true the number will be shown together with the bar chart in the cell.
|
void |
showNumberAndChart(boolean showNumberAndChart,
int widthOfLabel,
DecimalFormat numberFormat)
If true the number will be shown together with the bar chart in the cell.
|
void |
showNumberAndChart(boolean showNumberAndChart,
int widthOfLabel,
Font font,
int horizontalAlignement)
If true the number will be shown together with the bar chart in the cell.
|
void |
showNumberAndChart(boolean showNumberAndChart,
int widthOfLabel,
Font font,
int horizontalAlignement,
DecimalFormat numberFormat)
If true the number will be shown together with the bar chart in the cell.
|
void |
showNumbers(boolean showNumbers)
Set if the underlying numbers or the bar charts are to be shown.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public JSparklinesTwoValueBarChartTableCellRenderer(org.jfree.chart.plot.PlotOrientation plotOrientation, Double maxValue, Color firstValueColor, Color secondValueColor, boolean showFirstNumber)
plotOrientation
- the orientation of the plotmaxValue
- the maximum value to be plotted, used to make sure that
all plots in the same column has the same maximum value and are thus
comparablefirstValueColor
- the color to use for the first valuesecondValueColor
- the color to use for the second valueshowFirstNumber
- if true, the first value is shown when showing the
values, false shows the sumpublic JSparklinesTwoValueBarChartTableCellRenderer(org.jfree.chart.plot.PlotOrientation plotOrientation, Double maxValue, Color firstValueColor, Color secondValueColor, Color fillColor, boolean showFirstNumber)
plotOrientation
- the orientation of the plotmaxValue
- the maximum value to be plotted, used to make sure that
all plots in the same column has the same maximum value and are thus
comparablefirstValueColor
- the color to use for the first valuesecondValueColor
- the color to use for the second valuefillColor
- the color used to fill the rest of the chart up to the
max value (set to null if no filling should be used)showFirstNumber
- if true, the first value is shown when showing the
values, false shows the sumpublic void showNumberAndChart(boolean showNumberAndChart, int widthOfLabel)
showNumberAndChart
- if true the number and the chart is shown in
the cellwidthOfLabel
- the width used to display the label containing the
numberpublic void showNumberAndChart(boolean showNumberAndChart, int widthOfLabel, DecimalFormat numberFormat)
showNumberAndChart
- if true the number and the chart is shown in
the cellwidthOfLabel
- the width used to display the label containing the
numbernumberFormat
- the decimal format to use when showing the numberspublic void showNumberAndChart(boolean showNumberAndChart, int widthOfLabel, Font font, int horizontalAlignement)
showNumberAndChart
- if true the number and the chart is shown in
the cellwidthOfLabel
- the width used to display the label containing the
numberfont
- the font to use for the labelhorizontalAlignement
- the horizontal alignment of the text in the
label: one of the following constants defined in SwingConstants: LEFT,
CENTER, RIGHT, LEADING or TRAILING.public void showNumberAndChart(boolean showNumberAndChart, int widthOfLabel, Font font, int horizontalAlignement, DecimalFormat numberFormat)
showNumberAndChart
- if true the number and the chart is shown in
the cellwidthOfLabel
- the width used to display the label containing the
numberfont
- the font to use for the labelhorizontalAlignement
- the horizontal alignment of the text in the
label: one of the following constants defined in SwingConstants: LEFT,
CENTER, RIGHT, LEADING or TRAILING.numberFormat
- the decimal format to use when showing the numberspublic void showNumbers(boolean showNumbers)
showNumbers
- if true the underlying numbers are shownpublic void showFirstNumber(boolean showFirstNumber)
showFirstNumber
- show first number only?public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface TableCellRenderer
public void addReferenceLine(String label, double value, float lineWidth, Color lineColor)
label
- the label for the referencevalue
- the reference line valuelineWidth
- the line width, has to non-negativelineColor
- the line colorpublic void addReferenceLine(ReferenceLine referenceLine)
referenceLine
- the reference linepublic void removeReferenceLine(String label)
label
- the reference to removepublic void removeAllReferenceLines()
public HashMap<String,ReferenceLine> getAllReferenceLines()
public void addReferenceArea(String label, double start, double end, Color areaColor, float alpha)
label
- the label for the reference areastart
- the start of the reference areaend
- the end of the reference areaareaColor
- the color of the reference areaalpha
- the alpha level of the reference area, range: 0.0 to 1.0public void addReferenceArea(ReferenceArea referenceArea)
referenceArea
- the reference areapublic void removeReferenceArea(String label)
label
- the reference to removepublic void removeAllReferenceAreas()
public HashMap<String,ReferenceArea> getAllReferenceAreas()
public void setMaxValue(double maxValue)
maxValue
- the maximum valuepublic Color getFirstValueColor()
public void setFirstValueColor(Color firstValueColor)
firstValueColor
- the color to setpublic Color getSecondValueColor()
public void setSecondValueColor(Color secondValueColor)
secondValueColor
- the color to setpublic org.jfree.chart.plot.PlotOrientation getPlotOrientation()
public void setPlotOrientation(org.jfree.chart.plot.PlotOrientation plotOrientation)
plotOrientation
- the new plot orientationpublic org.jfree.chart.ChartPanel getChartPanel()
public void setBackgroundColor(Color color)
color
- the new background colorpublic double getMaxValue()
Copyright © 2016. All rights reserved.