|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.chart.JLChart
public class JLChart
A Class to handle 2D graphics plot.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected javax.swing.JPopupMenu |
chartMenu
|
protected java.awt.Window |
dialogParent
|
static java.lang.String |
FR_DATE_FORMAT
|
static int |
LABEL_DOWN
Place label at the bottom of the chart |
static int |
LABEL_LEFT
Place label at the left of the chart |
static int |
LABEL_RIGHT
Place label at the right of the chart |
static int |
LABEL_ROW
Place label at the bottom of the chart and try to arrange them in rows |
static int |
LABEL_UP
Place label at the top of the chart |
protected java.util.Vector<fr.esrf.tangoatk.widget.util.chart.LabelRect> |
labelRect
|
protected java.lang.String |
lastDataFileLocation
|
protected javax.swing.filechooser.FileFilter |
lastFileFilter
|
protected java.lang.String |
lastSnapshotLocation
|
protected double |
maxDisplayDuration
|
static int |
MENU_CHARTPROP
|
static int |
MENU_DATASAVE
|
static int |
MENU_DVPROP
|
static int |
MENU_PRINT
|
static int |
MENU_STAT
|
static int |
MENU_TABLE
|
protected boolean |
modalDialog
|
protected java.lang.String |
noValueString
|
protected boolean |
preferDialog
|
protected javax.swing.JDialog |
tableDialog
|
static java.lang.String |
US_DATE_FORMAT
|
| 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 | |
|---|---|
JLChart()
Graph constructor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
void |
addData(JLDataView v,
double x,
double y)
Add data to dataview , perform fast update when possible and garbage old data (if a display duration is specified). |
void |
addJLChartActionListener(IJLChartActionListener l)
Add the specified JLChartAction listener to the list |
void |
addMenuItem(javax.swing.JMenuItem menu)
Method to add item to the contextual menu. |
void |
addSeparator()
Method to add a separator to the contextual menu. |
void |
addUserAction(java.lang.String name)
Adds a user action. |
void |
applyConfiguration(CfFileReader f)
Apply graph configuration. |
protected java.lang.String[] |
buildPanelString(SearchInfo si)
|
void |
enterZoom()
Enter zoom mode. |
void |
exitZoom()
Exit zoom mode. |
int |
garbageData(JLDataView v)
Remove points that exceed displayDuration. |
java.awt.Color |
getChartBackground()
Gets the chart background (curve area) |
java.lang.String |
getConfiguration()
Build a configuration string that can be write into a file and is compatible with CfFileReader. |
double |
getDisplayDuration()
Gets the display duration. |
protected java.lang.String |
getExtension(java.io.File f)
getExtension returns the extension of a given file, that
is the part after the last `.' in the filename. |
java.lang.String |
getHeader()
Gets the current header |
java.awt.Font |
getHeaderFont()
Gets the header font |
java.lang.String |
getHelpString()
Returns a string containing the configuration file help. |
java.awt.Font |
getLabelFont()
Returns the label font |
int |
getLabelPlacement()
Returns the current label placement. |
java.awt.Dimension |
getMargin()
Gets the current margin |
double |
getMaxDisplayDuration()
Gets the maximum allowed for a display duration |
java.lang.String |
getNoValueString()
Used with saveDataFile(). |
int |
getTimePrecision()
Returns the allowed margin to make a projection on a line on data show (default: 0). |
JLAxis |
getXAxis()
Return a handle to the x axis |
JLAxis |
getY1Axis()
Return a handle to the left y axis |
JLAxis |
getY2Axis()
Return a handle to the right y axis |
boolean |
isLabelVisible()
Determines wether labels are visivle or not. |
boolean |
isPaintAxisFirst()
Return painting order between axis and curve |
boolean |
isXAxisOnBottom()
tells weather x Axis is on bottom of screen or not |
boolean |
isZoomed()
Determines wether the graph is zoomed. |
void |
loadDataFile(java.lang.String fileName)
Loads a data file and add the corresponding data to Y1 axis |
static void |
main(java.lang.String[] args)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
Paint the components. |
void |
printGraph()
Prints out this graph. |
void |
refreshTableSingle(JLDataView v)
|
void |
removeDataView(JLDataView view)
|
void |
removeJLChartActionListener(IJLChartActionListener l)
Remove the specified JLChartAction Listener |
void |
removeMenuItem(int menu)
Method to remove item of the contextual menu. |
void |
removeUserAction(java.lang.String name)
Removes a user action from chart menu. |
void |
reset()
|
protected void |
reset(boolean showConfirmDialog)
|
void |
setBackground(java.awt.Color c)
|
void |
setChartBackground(java.awt.Color c)
Sets the chart background (curve area) |
void |
setDisplayDuration(double v)
Sets the display duration.This will garbage old data in all displayed data views. |
void |
setHeader(java.lang.String s)
Sets the header and displays it. |
void |
setHeaderColor(java.awt.Color c)
Sets the header color |
void |
setHeaderFont(java.awt.Font f)
Sets header font |
void |
setHeaderVisible(boolean b)
Displays or hides header. |
void |
setJLChartListener(IJLChartListener l)
Set the specified JLChart Listener |
void |
setLabelFont(java.awt.Font f)
Sets the label font |
void |
setLabelPlacement(int p)
Set the label placement. |
void |
setLabelVisible(boolean b)
Displays or hide labels. |
void |
setMargin(java.awt.Dimension d)
Sets component margin |
void |
setMaxDisplayDuration(double maxDisplayDuration)
Sets the maximum allowed for a display duration |
void |
setNoValueString(java.lang.String noValueString)
Used with saveDataFile(). |
void |
setPaintAxisFirst(boolean b)
Paints axis under curve when true |
void |
setParentForTableDialog(java.awt.Dialog parent)
Sets the parent that the "show table" dialog should have (in case you chose to have a dialog) |
void |
setParentForTableDialog(java.awt.Frame parent)
Sets the parent that the "show table" dialog should have (in case you chose to have a dialog) |
void |
setPreferDialogForTable(boolean preferDialog,
boolean modal)
Sets if you prefer to use a JDialog with showTableXXX() methods instead of the classic JFrame |
void |
setTimePrecision(int milliseconds)
Sets the allowed margin to make a projection on a line on data show. |
void |
setXAxisOnBottom(boolean b)
Sets weather x Axis is on bottom of screen or not |
void |
showDataOptionDialog(JLDataView v)
Display the data view option dialog. |
void |
showOptionDialog()
Display the global graph option dialog. |
void |
showPanel(java.awt.Graphics g,
SearchInfo si)
Display the value tooltip. |
protected void |
showTableAll()
|
void |
unselectAll()
Remove all dataview from the graph. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, 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, updateUI |
| 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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, 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, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int LABEL_DOWN
public static final int LABEL_UP
public static final int LABEL_RIGHT
public static final int LABEL_LEFT
public static final int LABEL_ROW
public static final int MENU_CHARTPROP
public static final int MENU_DVPROP
public static final int MENU_TABLE
public static final int MENU_DATASAVE
public static final int MENU_PRINT
public static final int MENU_STAT
public static final java.lang.String US_DATE_FORMAT
public static final java.lang.String FR_DATE_FORMAT
protected java.util.Vector<fr.esrf.tangoatk.widget.util.chart.LabelRect> labelRect
protected double maxDisplayDuration
protected javax.swing.JPopupMenu chartMenu
protected boolean preferDialog
protected boolean modalDialog
protected javax.swing.JDialog tableDialog
protected java.awt.Window dialogParent
protected java.lang.String lastSnapshotLocation
protected java.lang.String lastDataFileLocation
protected javax.swing.filechooser.FileFilter lastFileFilter
protected java.lang.String noValueString
| Constructor Detail |
|---|
public JLChart()
| Method Detail |
|---|
public JLAxis getXAxis()
public JLAxis getY1Axis()
public JLAxis getY2Axis()
public void setXAxisOnBottom(boolean b)
b - boolean to know weather x Axis is on bottom of screen or notpublic boolean isXAxisOnBottom()
public void setHeaderFont(java.awt.Font f)
f - Header fontgetHeaderFont()public java.awt.Font getHeaderFont()
setHeaderFont(java.awt.Font)public void setMargin(java.awt.Dimension d)
d - MargingetMargin()public java.awt.Dimension getMargin()
setMargin(java.awt.Dimension)public void setBackground(java.awt.Color c)
setBackground in class javax.swing.JComponentpublic void setChartBackground(java.awt.Color c)
c - Background colorpublic java.awt.Color getChartBackground()
public void setPaintAxisFirst(boolean b)
b - Painting orderpublic boolean isPaintAxisFirst()
public void setHeaderVisible(boolean b)
b - true if the header is visible, false otherwisesetHeader(java.lang.String)public void setHeader(java.lang.String s)
s - Graph headergetHeader()public java.lang.String getHeader()
setHeader(java.lang.String)public void setDisplayDuration(double v)
v - Displauy duration (millisec). Pass Double.POSITIVE_INFINITY to disable.addData(fr.esrf.tangoatk.widget.util.chart.JLDataView, double, double)public double getDisplayDuration()
setDisplayDuration(double)public double getMaxDisplayDuration()
setMaxDisplayDuration(double),
setDisplayDuration(double)public void setMaxDisplayDuration(double maxDisplayDuration)
maxDisplayDuration - The maximum allowed for a display durationgetMaxDisplayDuration(),
getDisplayDuration(),
setDisplayDuration(double)public void setHeaderColor(java.awt.Color c)
c - Header colorpublic void setLabelVisible(boolean b)
b - true if labels are visible, false otherwiseisLabelVisible()public boolean isLabelVisible()
public void setLabelPlacement(int p)
p - PlacementLABEL_UP,
LABEL_DOWN,
LABEL_ROW,
LABEL_LEFT,
LABEL_RIGHTpublic int getLabelPlacement()
setLabelPlacement(int)public void setLabelFont(java.awt.Font f)
f - public java.awt.Font getLabelFont()
setLabelFont(java.awt.Font)public void showOptionDialog()
public void showDataOptionDialog(JLDataView v)
public boolean isZoomed()
public void enterZoom()
public void setJLChartListener(IJLChartListener l)
l - JLChart listener. If set to null the listener will be removed.public void addUserAction(java.lang.String name)
name - Action namepublic void removeUserAction(java.lang.String name)
name - Action namepublic void addJLChartActionListener(IJLChartActionListener l)
l - Listener to addpublic void exitZoom()
public void removeMenuItem(int menu)
menu - Item to removeMENU_CHARTPROP,
MENU_DVPROP,
MENU_TABLE,
MENU_DATASAVE,
MENU_PRINT,
MENU_STATpublic void addMenuItem(javax.swing.JMenuItem menu)
menu - MenuItem to addpublic void addSeparator()
public void removeJLChartActionListener(IJLChartActionListener l)
l - Listener to removepublic void applyConfiguration(CfFileReader f)
f - Handle to CfFileReader object that contains global graph paramCfFileReader.parseText(java.lang.String),
CfFileReader.readFile(java.lang.String),
JLAxis.applyConfiguration(java.lang.String, fr.esrf.tangoatk.widget.util.chart.CfFileReader),
JLDataView.applyConfiguration(java.lang.String, fr.esrf.tangoatk.widget.util.chart.CfFileReader)public java.lang.String getConfiguration()
applyConfiguration(fr.esrf.tangoatk.widget.util.chart.CfFileReader),
JLDataView.getConfiguration(java.lang.String),
JLAxis.getConfiguration(java.lang.String)public java.lang.String getHelpString()
public void unselectAll()
public void printGraph()
public void loadDataFile(java.lang.String fileName)
fileName - the full path of the data filepublic void refreshTableSingle(JLDataView v)
protected void showTableAll()
protected java.lang.String getExtension(java.io.File f)
getExtension returns the extension of a given file, that
is the part after the last `.' in the filename.
f - a File value
String valuepublic void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed in interface java.awt.event.ActionListenerpublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - Graphics object.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerprotected java.lang.String[] buildPanelString(SearchInfo si)
public void showPanel(java.awt.Graphics g,
SearchInfo si)
g - Graphics objectsi - SearchInfo structure.JLAxis.searchNearest(int, int, fr.esrf.tangoatk.widget.util.chart.JLAxis)public int garbageData(JLDataView v)
v - DataView containing points
public void addData(JLDataView v,
double x,
double y)
v - The dataviewx - x coordinates (real space)y - y coordinates (real space)setDisplayDuration(double)public void setTimePrecision(int milliseconds)
milliseconds - the margin, in millisecondspublic int getTimePrecision()
public java.lang.String getNoValueString()
public void setNoValueString(java.lang.String noValueString)
noValueString - The String used to represent "no data"
public void setPreferDialogForTable(boolean preferDialog,
boolean modal)
preferDialog - Prefer to have a dialog or notmodal - The dialog should be modal or notpublic void setParentForTableDialog(java.awt.Frame parent)
parent - The parentsetPreferDialogForTable(boolean, boolean)public void setParentForTableDialog(java.awt.Dialog parent)
parent - The parentsetPreferDialogForTable(boolean, boolean)public void removeDataView(JLDataView view)
public void reset()
protected void reset(boolean showConfirmDialog)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||