Package no.uib.jsparklines.renderers
Class JSparklines3dTableCellRenderer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
no.uib.jsparklines.renderers.JSparklines3dTableCellRenderer
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,SwingConstants
,TableCellRenderer
public class JSparklines3dTableCellRenderer extends JLabel implements TableCellRenderer
Table cell renderer displaying JSparklines 3D plots consisting of multiple
values per data series. Supported input: JSparklines3dDataset objects. Other
object types are rendered using the DefaultTableCellRenderer.
- Author:
- Harald Barsnes
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JSparklines3dTableCellRenderer.PlotType
List of supported plot types for JSparklines3dTableCellRenderer.Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
Constructors Constructor Description JSparklines3dTableCellRenderer(JSparklines3dTableCellRenderer.PlotType plotType, Double minXValue, Double maxXValue, Double minYValue, Double maxYValue)
Creates a new JSparkLines3dTableCellRenderer. -
Method Summary
Modifier and Type Method Description void
addXAxisReferenceArea(String label, double start, double end, Color areaColor, float alpha)
Add a x-axis reference area.void
addXAxisReferenceLine(String label, double value, float lineWidth, Color lineColor)
Add a reference line at a given x-axis data value.void
addYAxisReferenceArea(String label, double start, double end, Color areaColor, float alpha)
Add a y-axis reference area.void
addYAxisReferenceLine(String label, double value, float lineWidth, Color lineColor)
Add a reference line at a given y-axis data value.HashMap<String,ReferenceLine>
getAllXAxisReferenceLines()
Returns all the x-axis references lines as a hashmap, with the labels as the keys.HashMap<String,ReferenceLine>
getAllYAxisReferenceLines()
Returns all the y-axis references lines as a hashmap, with the labels as the keys.org.jfree.chart.ChartPanel
getChartPanel()
Returns a reference to the chart panel.Component
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
HashMap<String,ReferenceArea>
getXAxisAllReferenceAreas()
Returns all the x-axis references areas as a hashmap, with the labels as the keys.HashMap<String,ReferenceArea>
getYAxisAllReferenceAreas()
Returns all the y-axis references areas as a hashmap, with the labels as the keys.void
removeAllXAxisReferenceAreas()
Removes all the x-axis reference areas.void
removeAllXAxisReferenceLines()
Removes all x-axis reference lines.void
removeAllYAxisReferenceAreas()
Removes all the y-axis reference areas.void
removeAllYAxisReferenceLines()
Removes all y-axis reference lines.void
removeXAxisReferenceArea(String label)
Removes the x-axis reference area with the given label.void
removeXAxisReferenceLine(String label)
Removes the x-axis reference line with the given label.void
removeYAxisReferenceArea(String label)
Removes the y-axis reference area with the given label.void
removeYAxisReferenceLine(String label)
Removes the y-axis reference line with the given label.void
setMaxXValue(double maxXValue)
Set the maximum x value.void
setMaxYValue(double maxYValue)
Set the maximum y value.void
setMinXValue(double minXValue)
Set the minimum x value.void
setMinYValue(double minYValue)
Set the minimum y value.void
setPlotType(JSparklines3dTableCellRenderer.PlotType plotType)
Sets the plot type.Methods inherited from class javax.swing.JLabel
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
Methods inherited from class javax.swing.JComponent
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
Methods inherited from class java.awt.Container
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
Methods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
JSparklines3dTableCellRenderer
public JSparklines3dTableCellRenderer(JSparklines3dTableCellRenderer.PlotType plotType, Double minXValue, Double maxXValue, Double minYValue, Double maxYValue)Creates a new JSparkLines3dTableCellRenderer.- Parameters:
plotType
- the plot typeminXValue
- the minimum x value to be plotted, used to make sure that all plots in the same column has the same minimum x value and are thus comparablemaxXValue
- the maximum x value to be plotted, used to make sure that all plots in the same column has the same maximum x value and are thus comparableminYValue
- the minimum y value to be plotted, used to make sure that all plots in the same column has the same minimum y value and are thus comparablemaxYValue
- the maximum y value to be plotted, used to make sure that all plots in the same column has the same maximum y value and are thus comparable- Throws:
IllegalArgumentException
- if minXValue > maxXValue or minYValue > maxYValue
-
-
Method Details
-
getTableCellRendererComponent
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)- Specified by:
getTableCellRendererComponent
in interfaceTableCellRenderer
-
addXAxisReferenceLine
Add a reference line at a given x-axis data value.- Parameters:
label
- the label for the referencevalue
- the reference line valuelineWidth
- the line width, has to non-negativelineColor
- the line color
-
removeXAxisReferenceLine
Removes the x-axis reference line with the given label. Does nothing if no reference with the given label is found.- Parameters:
label
- the reference to remove
-
removeAllXAxisReferenceLines
public void removeAllXAxisReferenceLines()Removes all x-axis reference lines. -
getAllXAxisReferenceLines
Returns all the x-axis references lines as a hashmap, with the labels as the keys.- Returns:
- hashmap of all reference lines
-
addXAxisReferenceArea
public void addXAxisReferenceArea(String label, double start, double end, Color areaColor, float alpha)Add a x-axis reference area.- Parameters:
label
- the label for the reference areastart
- the start of the reference areaend
- the end of the reference areaareaColor
- the color of the areaalpha
- the alpha level, range: 0.0 to 1.0
-
removeXAxisReferenceArea
Removes the x-axis reference area with the given label. Does nothing if no reference with the given label is found.- Parameters:
label
- the reference to remove
-
removeAllXAxisReferenceAreas
public void removeAllXAxisReferenceAreas()Removes all the x-axis reference areas. -
getXAxisAllReferenceAreas
Returns all the x-axis references areas as a hashmap, with the labels as the keys.- Returns:
- hashmap of all reference areas
-
addYAxisReferenceLine
Add a reference line at a given y-axis data value.- Parameters:
label
- the label for the referencevalue
- the reference line valuelineWidth
- the line width, has to non-negativelineColor
- the line color
-
removeYAxisReferenceLine
Removes the y-axis reference line with the given label. Does nothing if no reference with the given label is found.- Parameters:
label
- the reference to remove
-
removeAllYAxisReferenceLines
public void removeAllYAxisReferenceLines()Removes all y-axis reference lines. -
getAllYAxisReferenceLines
Returns all the y-axis references lines as a hashmap, with the labels as the keys.- Returns:
- hashmap of all reference lines
-
addYAxisReferenceArea
public void addYAxisReferenceArea(String label, double start, double end, Color areaColor, float alpha)Add a y-axis reference area.- Parameters:
label
- the label for the reference areastart
- the start of the reference areaend
- the end of the reference areaareaColor
- the color of the areaalpha
- the alpha level, range: 0.0 to 1.0
-
removeYAxisReferenceArea
Removes the y-axis reference area with the given label. Does nothing if no reference with the given label is found.- Parameters:
label
- the reference to remove
-
removeAllYAxisReferenceAreas
public void removeAllYAxisReferenceAreas()Removes all the y-axis reference areas. -
getYAxisAllReferenceAreas
Returns all the y-axis references areas as a hashmap, with the labels as the keys.- Returns:
- hashmap of all reference areas
-
setMaxXValue
public void setMaxXValue(double maxXValue)Set the maximum x value.- Parameters:
maxXValue
- the maximum x value
-
setMinXValue
public void setMinXValue(double minXValue)Set the minimum x value.- Parameters:
minXValue
- the minimum x value
-
setMaxYValue
public void setMaxYValue(double maxYValue)Set the maximum y value.- Parameters:
maxYValue
- the maximum y value
-
setMinYValue
public void setMinYValue(double minYValue)Set the minimum y value.- Parameters:
minYValue
- the minimum y value
-
setPlotType
Sets the plot type.- Parameters:
plotType
- the plotType to set
-
getChartPanel
public org.jfree.chart.ChartPanel getChartPanel()Returns a reference to the chart panel.- Returns:
- the chart panel.
-