public class SNTChart extends ChartFrame
ChartFrame
with convenience methods for plot annotations.JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
|
SNTChart(String title,
net.imagej.plot.CategoryChart<?> categoryChart) |
|
SNTChart(String title,
JFreeChart chart) |
protected |
SNTChart(String title,
JFreeChart chart,
Dimension preferredSize) |
|
SNTChart(String title,
net.imagej.plot.XYPlot xyplot) |
Modifier and Type | Method and Description |
---|---|
void |
annotate(String label)
Adds a subtitle to the chart.
|
void |
annotateCategory(String category,
String label)
Annotates the specified category (Category plots only)
|
void |
annotateCategory(String category,
String label,
String color)
Annotates the specified category (Category plots only).
|
void |
annotatePoint(double x,
double y,
String label)
Highlights a point in a histogram/XY plot by drawing a labeled arrow at the
specified location.
|
void |
annotatePoint(double x,
double y,
String label,
String color)
Highlights a point in a histogram/XY plot by drawing a labeled arrow at the
specified location.
|
void |
annotateXline(double xValue,
String label)
Annotates the specified X-value (XY plots and histograms).
|
void |
annotateXline(double xValue,
String label,
String color)
Annotates the specified X-value (XY plots and histograms).
|
void |
annotateYline(double yValue,
String label)
Annotates the specified Y-value (XY plots and histograms).
|
void |
annotateYline(double yValue,
String label,
String color)
Annotates the specified Y-value (XY plots and histograms).
|
void |
applyStyle(SNTChart template) |
boolean |
containsValidData() |
void |
dispose() |
protected void |
exportAsCSV(File file) |
static void |
main(String[] args) |
void |
saveAsPNG(File file) |
void |
saveAsPNG(String filePath) |
void |
setAxesVisible(boolean visible) |
void |
setColors(ColorTable colorTable)
(Re)colors existing dataset series
|
void |
setColors(String... colors)
(Re)colors existing dataset series
|
void |
setDefaultDirectoryForSaveAs(File directory) |
void |
setFontSize(float size)
Sets the font size to all components of this chart.
|
void |
setFontSize(float size,
String scope)
Sets the font size for this chart.
|
void |
setGridlinesVisible(boolean visible) |
void |
setOutlineVisible(boolean visible) |
void |
show() |
void |
show(int width,
int height) |
getChartPanel
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
public SNTChart(String title, JFreeChart chart)
public SNTChart(String title, net.imagej.plot.XYPlot xyplot)
public SNTChart(String title, net.imagej.plot.CategoryChart<?> categoryChart)
protected SNTChart(String title, JFreeChart chart, Dimension preferredSize)
public void annotateXline(double xValue, String label)
xValue
- the X value to be annotated.label
- the annotation labelpublic void annotateXline(double xValue, String label, String color)
xValue
- the X value to be annotated.label
- the annotation labelcolor
- the font colorpublic void annotateYline(double yValue, String label)
yValue
- the Y value to be annotated.label
- the annotation labelpublic void annotateYline(double yValue, String label, String color)
yValue
- the Y value to be annotated.label
- the annotation labelcolor
- the font colorpublic void setAxesVisible(boolean visible)
public void setGridlinesVisible(boolean visible)
public void setOutlineVisible(boolean visible)
public void annotateCategory(String category, String label)
category
- the category to be annotated. Ignored if it does not exits in
category axis.label
- the annotation labelpublic void annotateCategory(String category, String label, String color)
category
- the category to be annotated. Ignored if it does not exits in
category axis.label
- the annotation labelcolor
- the annotation colorpublic void setColors(String... colors)
colors
- The series colorspublic void setColors(ColorTable colorTable)
colorTable
- The colorTable used to recolor seriespublic void setFontSize(float size)
size
- the new font sizepublic void setFontSize(float size, String scope)
size
- the new font sizescope
- which components should be modified. Either "axes", "legends",
or "labels" (singular/plural allowed)public void saveAsPNG(File file) throws IOException
IOException
public void saveAsPNG(String filePath) throws IOException
IOException
public void applyStyle(SNTChart template)
public void annotate(String label)
label
- the subtitle textpublic void annotatePoint(double x, double y, String label)
x
- the x-coordinatey
- the y-coordinatelabel
- the annotation labelpublic void annotatePoint(double x, double y, String label, String color)
x
- the x-coordinatey
- the y-coordinatelabel
- the annotation labelcolor
- the annotation colorpublic void setDefaultDirectoryForSaveAs(File directory) throws IllegalArgumentException
IllegalArgumentException
public void show(int width, int height)
public boolean containsValidData()
protected void exportAsCSV(File file) throws IllegalStateException
IllegalStateException
public static void main(String[] args)
Copyright © 2015–2021 Fiji. All rights reserved.